<template xmlns:v-on="http://www.w3.org/1999/xhtml">
    <div class="addrest">
        <div class="main_left">
            <div class="searchInput">
                <div class="searchIcon"></div>
                <div>
                    <input maxlength="255" v-model.trim="keyword" type="text" placeholder="搜索" @input="getRequest()" @keyup='getRequestKey($event)'>
                </div>
                <div class="xicon" @click="emptyKeyword" v-show="keyword != ''">
                </div>
            </div>
            <!-- 搜索内容列表 -->
            <div class="searchList" v-show="isSearchList == true">
                <ul id='searchListId'>
                    <li v-for="(item,index) in searchDatas" :class="{selectback:index==now}" @mouseover="selectHover(index)" @click="searchLiClick(index)"
                        :key="index">
                        <div>
                            <img v-if='item.profile' :src="item.profile" alt="">
                            <div v-if='!item.profile' class="imgNo">
                                {{item.memberName | nameFun}}
                            </div>
                        </div>
                        <div :title="item.memberName">{{item.memberName}}</div>
                        <div :title="item.position?item.position:'暂无职位'">{{item.position?item.position:'暂无职位'}}</div>
                        <div>{{item.mobile}}</div>
                    </li>
                </ul>
            </div>
            <div class="searchList nosearchList" v-show="isnoSearchList == true">
                <p>抱歉，什么都没搜到</p>
            </div>
            <div>
                <div id="treeBox" v-if='ztreeDataSource.length>0'>
                    <div class="pantidname" v-if='root == 0'>{{parentOrgName}}</div>
                    <vue-ztree :list.sync='ztreeDataSource' :func='nodeClick' :is-open='false'></vue-ztree>
                </div>
            </div>
        </div>
        <div class="main_right" v-show="isAuthority">
            <div>
                <div class="navTitle" v-show="isBranch == false">
                    <div>
                        {{businessName}}
                        <small v-show="iscreatemsgCompany == 1">企业群</small>
                    </div>
                    <!-- <div @click="setBusinessClick">设置</div> -->
                    <el-button size="small" @click="setBusinessClick">设置</el-button>
                </div>
                <div class="navTitle" v-show="isBranch == true">
                    <div>
                        {{selectBranch}}
                        <small v-show="iscreatemsg == 1">部门群</small>
                    </div>
                    <!-- <div @click="editBranch">设置</div> -->
                    <el-button size="small" @click="editBranch">设置</el-button>
                </div>
                <div class="nav">
                    <ol class="breadcrumbs">
                        <li id="parentOrgName" v-show="parentOrgName !== undefined">
                            <a>{{parentOrgName}}</a>
                        </li>
                        <li v-for="(item,index) in dataList" @click="breadcrumbLiClick(index,item)" :key="index">
                            <span v-show="!(parentOrgName == undefined && index == 0)">></span>
                            <span>{{item.name}}</span>
                        </li>
                    </ol>
                </div>
            </div>
            <div>
                <div class="smallCompany" v-show=" root == '1' && parentOrgName == null && dataList.length == 1">
                    <div>
                        <div class="mr_10">
                            <img src="/static/img/iconfont_page_company.png" alt="">
                        </div>
                        <div class="font_18">子公司</div>
                    </div>
                    <el-button size="small" @click="addChildrenCompanyClick">添加子公司</el-button>
                </div>
                <ul class="childrenCompanyUl" v-show=" root == '1' && parentOrgName == null && dataList.length == 1">
                    <li v-for="(item,index) in companyListSlice" :key="index">
                        <div :title="item.oName">{{item.name}}</div>
                        <div :title="item.oAdmin">{{item.managerName}}</div>
                        <div :title="item.oMobile">{{item.phoneNumber}}</div>
                        <div @click="editChildrenCompanyClick(index)">
                            <img src="/static/img/compile.png" alt="">
                        </div>
                    </li>
                    <div class="lookAll" @click="lookAllcompanyList" v-show="companyList.length > 10 && companyListSlice.length !== companyList.length">查看全部</div>
                    <div class="lookAll" @click="lookPartcompanyList" v-show="companyList.length > 10 && companyListSlice.length == companyList.length">收起</div>
                    <p class="noChildren" v-show="companyList.length == 0 && parentOrgName == null">当前企业不包含子公司</p>
                </ul>
                <div class="smallCompany">
                    <div>
                        <div class="mr_10">
                            <img src="/static/img/下一级.png" alt="">
                        </div>
                        <div class="font_18">下级部门</div>
                    </div>
                    <div>
                        <el-button :class="{graybutStyle:isgraybutStyle}" size="small" @click="adjustSort">调整排序</el-button>
                        <el-button size="small" @click="addBranchClick">添加子部门</el-button>
                    </div>
                </div>
                <div class="sortTip" v-show="dragLi == true">
                    <span>上下拖动调整排序</span>
                    <span @click="sortSave">保存</span>
                    <span @click="revokeSort">撤销</span>
                </div>
                <ul class="subDepartments" v-show="departmentList.length > 0 && dragLi == true">
                    <draggable v-model="departmentList" @start="drag=true" @end="drag=false">
                        <li v-for="(item,index) in departmentList" :key="index">
                            <div :title="item.name">
                                <img src="/static/img/iconfont_page_sequence.png" alt="">
                                <div class="subDepartments-name">{{item.name}}</div>
                                <div>({{item.memberCount}}人)</div>
                            </div>
                            <div class="angleIcon"></div>
                        </li>
                    </draggable>
                </ul>
                <ul class="subDepartments" v-show="departmentList.length > 0 && dragLi == false">
                    <li :key="index" v-for="(item,index) in departmentListSlice" @click="childBranch(item)">
                        <div>
                            <div class="subDepartments-name">{{item.name}}</div>
                            <div>({{item.memberCount}}人)</div>
                        </div>
                        <div class="angleIcon"></div>
                    </li>
                    <div v-show="departmentListSlice.length !== departmentList.length && departmentList.length>10" class="lookAll" @click="lookAlldepartment">查看全部</div>
                    <div v-show="departmentListSlice.length == departmentList.length && departmentList.length>10" class="lookAll" @click="lookPartdepartment">收起</div>
                </ul>
                <p class="noChildren" v-show="departmentList.length == 0">当前部门不包含下级部门</p>
                <div class="smallCompany" id="smallCompanyBorder">
                    <div>
                        <div class="mr_10">
                            <img src="/static/img/iconfont_page_personnel.png" alt="">
                        </div>
                        <div class="font_18">部门人员</div>
                    </div>
                    <div>
                    </div>
                </div>
                <div class="butBox">
                    <el-button size="small" @click="addMemberClick">添加成员</el-button>
                    <el-button size="small" @click="batchImport">批量导入/出</el-button>
                    <!-- <div class="butStyle" @click="team">团队邀请</div> -->
                    <el-button :class="{graybutStyle:isgraybutStyle_1}" size="small" @click="adjustBranch">调整部门</el-button>
                    <el-button :class="{graybutStyle:isgraybutStyle_1}" size="small" @click="adjustSortMember">调整排序</el-button>
                    <el-button :class="{graybutStyle:isgraybutStyle_1}" size="small" @click="batchDel">批量删除</el-button>
                </div>
                <div class="sortTip sortTipMember" v-show="dragLiMember == true">
                    <span>上下拖动调整排序</span>
                    <span @click="sortSaveMember">保存</span>
                    <span @click="revokeSortMember">撤销</span>
                </div>
                <div class="branchData">
                    <ul v-show="dragLiMember == false && dataLists.length >0">
                        <li class="firstLi">
                            <div class="checkBoxCl">
                                <div>
                                    <el-checkbox v-model="checked" @change="numChange"></el-checkbox>
                                </div>
                                <div>
                                </div>
                            </div>
                            <div>姓名</div>
                            <div>职位</div>
                            <div>邮箱</div>
                            <div>手机号</div>
                        </li>
                        <li :key="index" :class="{dataLi:true,activeLi:isactiveLi == index}" v-for="(item,index) in dataLists" @mouseover="hoverLi(index)"
                            @mouseout="noHoverLi(index)" @click="editMember(index,item)">
                            <div class="checkCl" @click.stop='checkClickStop'>
                                <el-checkbox-group v-model="checkList" @change="handleCheckedCitiesChange">
                                    <el-checkbox :label="item" :key="">{{random}}</el-checkbox>
                                </el-checkbox-group>
                            </div>
                            <div :title="item.memberName">{{item.memberName}} </div>
                            <div :title="item.position">{{item.position}}</div>
                            <div :title="item.email">{{item.email}}</div>
                            <div :title="item.mobile">{{item.mobile}}</div>
                        </li>
                    </ul>
                    <ul v-show="dragLiMember == true && dataLists.length >0">
                        <li class="firstLi">
                            <div class="checkBoxCl"> </div>
                            <div>姓名</div>
                            <div>职位</div>
                            <div>邮箱</div>
                            <div>手机号</div>
                        </li>
                        <draggable v-model="dataLists" @start="drag=true" @end="drag=false">
                            <li :class="{dataLi:true,activeLi:isactiveLi == index}" v-for="(item,index) in dataLists" :key="item.userId" @mouseover="hoverLi(index)"
                                @mouseout="noHoverLi(index)" @click="editMember(index,item)">
                                <div class="checkCl" @click.stop='checkClickStop'>
                                    <div>
                                        <img src="/static/img/iconfont_page_sequence.png" alt="">
                                    </div>
                                </div>
                                <div :title="item.memberName">{{item.memberName}} </div>
                                <div :title="item.position">{{item.position}}</div>
                                <div :title="item.email">{{item.email}}</div>
                                <div :title="item.mobile">{{item.mobile}}</div>
                            </li>
                        </draggable>
                    </ul>
                    <p class="noChildren" v-show="dataLists.length == 0">当前部门下暂无人员</p>
                </div>
            </div>
        </div>
        <div class="main_right" v-show="!isAuthority">
            <div id="noAuthority">
                <img src="/static/img/suo.png" alt="">
                <p>对不起,没有权限</p>
            </div>
        </div>
        <!--编辑公司/编辑公司弹出框-->
        <div class="ModalsBox" v-show="setBusiness">
            <div class="ModalsLeft">
                <div class="modalsLeftTop">
                    编辑公司
                </div>
                <div class="ModalsLeftMain ModalsLeftMainCompany">
                    <div class="companyInfo">
                        <div class="font_16">公司信息</div>
                        <div></div>
                    </div>
                    <div class="companyInfoDetail">
                        <div v-show="false">
                            <span>母公司信息：</span>
                            <input :disabled="true" type="text" v-model="ParentcompanyName">
                        </div>
                        <div>
                            <span>公司名称：</span>
                            <input :disabled="true" type="text" v-model="BigcompanyName">
                        </div>
                        <div class="directorSelect">
                            <span>设置主管：</span>
                            <div id="directorSelect-right" :class="{redInput:isReddirector}" @click="setDirectorClick(4)">
                                <ul>
                                    <li v-for="(item,index) in directors" :key="index">
                                        <div>{{item.adminName}}</div>
                                        <div class="xicon" @click.stop="delDirector(index)">
                                        </div>
                                    </li>
                                </ul>
                            </div>
                            <br>
                        </div>
                        <p class="redFont" v-show="isReddirector == true">主管不能为空</p>
                    </div>
                    <div class="companyGroup">
                        <div class="font_16">企业群
                            <span class="created" v-show="iscreatemsgCompany == 1">√已创建</span>
                        </div>
                        <div class="dissolutionGroup" v-show="iscreatemsgCompany == 1" @click="dissolutionGroupCompany">解散该群</div>
                    </div>
                    <div class="companyGroupDetail" v-show="iscreatemsgCompany == 1">
                        <div>自动添加群成员</div>
                        <div @click="companyOpenClick">
                            <div v-show="companyOpen == true">
                                <span>开启</span>
                                <img src="/static/img/iconfont_page_open.png" alt="">
                            </div>
                            <div v-show="companyOpen == false">
                                <span>关闭</span>
                                <img src="/static/img/iconfont_page_colse.png" alt="">
                            </div>
                        </div>
                    </div>
                    <div class="newcomer" v-show="iscreatemsgCompany == 1">有新成员时会自动加入此群</div>
                    <div class="newcomer" v-show="iscreatemsgCompany == 0" id="nogroup">暂时没有群聊
                        <a @click="createGroupCompany">创建群聊</a>
                    </div>
                </div>
                <div class="modalLeftfoot modalLeftfootCompany">
                    <p id="noDelTip" v-show="departmentListSlice.length > 0 || dataLists.length > 0">该部门下有子部门或人员不能删除</p>
                    <el-button type="primary" size="medium" @click="bigCompantSave">保存</el-button>
                    <el-button type="info" size="medium" :disabled="departmentListSlice.length > 0 || dataLists.length > 0" @click="bigCompantDel">删除</el-button>
                    <el-button type="info" size="medium" @click="cancle">取消</el-button>
                    
                </div>
            </div>
        </div>
        <!--添加/编辑子公司-->
        <div class="ModalsBox" v-show="setChildrenBusiness">
            <div class="ModalsLeft">
                <div class="modalsLeftTop">
                    {{addCompanyTitle}}
                </div>
                <div class="ModalsLeftMain ModalsLeftMainCompany">
                    <div class="companyInfo">
                        <div class="font_16">子公司信息</div>
                        <div></div>
                    </div>
                    <div class="ChildcompanyInfoDetail">
                        <div>
                            <span>母公司名称：</span>
                            <input :disabled="true" type="text" v-model="ParentcompanyName">
                        </div>
                        <div>
                            <span>子公司名称：</span>
                            <input :class="{redInput:isBigcompanyName}" maxlength="30" type="text" v-model.trim="BigcompanyName" placeholder="最多输入30个字符">
                        </div>
                        <p class="redFont ml89" v-show="isBigcompanyName == true">{{BigcompanyNameText}}</p>
                        <div>
                            <span>所在地区：</span>
                            <div>
                                <select :class="{selectWidth:true,redInput:isRedselectedAreaone}" @change="selectedAreaoneClick" v-model="selectedAreaone">
                                    <option :key="type.id" v-for="(type,index) in selectedAreaones" :value="type.id">{{type.name}}</option>
                                </select>
                            </div>
                            <div id="areaSelectTwo">
                                <select :class="{selectWidth:true,redInput:isRedselectedAreatwo}" @change="selectedAreatwoClick" v-model="selectedAreatwo">
                                    <option :key="type.id" v-for="(type,index) in selectedAreatwos" :value="type.id">{{type.name}}</option>
                                </select>
                            </div>
                        </div>
                        <div>
                            <span>所属行业：</span>
                            <div>
                                <select :class="{selectWidth:true,redInput:isRedselectedTrade}" @change="selectedTradeClick" v-model="selectedTrade">
                                    <option :key="type.id" v-for="(type,index) in selectedTrades" :value="type.id">{{type.name}}</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="companyGroup">
                        <div class="font_16">管理员</div>
                    </div>
                    <div class="managerDetail">
                        <div>
                            <span>管理员姓名：</span>
                            <input :class="{redInput:isRedmanagerName}" maxlength="20" type="text" v-model.trim="managerName" placeholder="最多输入20个字符">
                        </div>
                        <p class="redFont ml89" v-show="isRedmanagerName == true">{{managerNameText}}</p>
                        <div>
                            <span>手机号码：</span>
                            <input :class="{redInput:isRedmanagerPhone}" type="text" v-model="managerPhone" placeholder="请输入手机号码">
                        </div>
                        <p class="redFont ml89" v-show="isRedmanagerPhone == true">{{managerPhoneText}}</p>
                        <div>
                            <h2>提示：</h2>
                            <p>1.如果新管理员手机号还未在平利县精准扶贫系统平台激活，则会收到平利县精准扶贫系统后台的通知短信，短信中有登录账号、密码。当信管理员登录激活后，修改或新增管理员方可生效。</p>
                            <p>2.如果新管理员手机号已经在平利县精准扶贫系统平台激活，则该管理员可直接用已激活手机号和密码登录，修改或新增管理员已经生效。</p>
                        </div>
                    </div>
                </div>
                <div class="modalLeftfoot modalLeftfootChildCompany">
                    <!-- <input type="button" value="保存" @click="addChildSave" v-show="addCompanyTitle == '添加子公司'">  -->
                    <el-button type="primary" size="medium" @click="addChildSave" v-show="addCompanyTitle == '添加子公司'">保存</el-button>
                    <el-button type="primary" size="medium" @click="editChildSave" v-show="addCompanyTitle == '编辑子公司'">保存</el-button>
                    <el-button type="info" size="medium" @click="childCompanyDel" v-show="addCompanyTitle == '编辑子公司'">删除</el-button>
                    <el-button type="info" size="medium" @click="cancle">取消</el-button>
                </div>
            </div>
        </div>
        <!--添加部门-->
        <div class="ModalsBox" v-show="setBranch">
            <div class="ModalsLeft">
                <div class="modalsLeftTop">
                    添加部门
                </div>
                <div class="ModalsLeftMain ModalsLeftMainCompany">
                    <div class="companyInfo">
                        <div class="font_16">部门信息</div>
                        <div></div>
                    </div>
                    <div class="companyInfoDetail">
                        <div id="higherBranchBox">
                            <span>上级部门：</span>
                            <input :disabled="true" type="text" v-model="superBranch">
                        </div>
                        <div>
                            <span>部门名称：</span>
                            <input id="branchNameInput" :class="{redInput:isRedbranchName}" maxlength="20" type="text" v-model.trim="branchName" placeholder="最多输入20个字符">
                        </div>
                        <p class="redFont" v-show="isRedbranchName == true">{{branchNameText}}</p>
                    </div>
                    <div class="companyGroup">
                        <div class="font_16">部门企业群</div>
                        <div></div>
                    </div>
                    <div class="companyGroupDetail">
                        <div>是否创建部门企业群</div>
                        <div @click="branchOpenClick">
                            <div v-show="branchOpen == true">
                                <span>开启</span>
                                <img src="/static/img/iconfont_page_open.png" alt="">
                            </div>
                            <div v-show="branchOpen == false">
                                <span>关闭</span>
                                <img src="/static/img/iconfont_page_colse.png" alt="">
                            </div>
                        </div>
                    </div>
                    <div class="newcomer">创建一个关联此部门的企业群，如果有新人加入部门会自动加入该群</div>
                </div>
                <div class="modalLeftfoot modalLeftfootsBranch">
                    <el-button type="primary" size="medium" @click="addBranchSave">保存</el-button>
                    <el-button type="info" size="medium" @click="cancle">取消</el-button>
                </div>
            </div>
        </div>
        <!--编辑部门-->
        <div class="ModalsBox" v-show="seteditBranch">
            <div class="ModalsLeft">
                <div class="modalsLeftTop">
                    编辑部门
                </div>
                <div class="ModalsLeftMain ModalsLeftMainCompany">
                    <div class="companyInfo">
                        <div class="font_16">部门信息</div>
                        <div></div>
                    </div>
                    <div class="branchInfoDetail">
                        <div>
                            <span>上级部门：</span>
                            <input :disabled="true" type="text" v-model="superBranch">
                        </div>
                        <div>
                            <span>部门名称：</span>
                            <input id="branchNameInputEdit" :class="{redInput:isRedbranchName}" maxlength="20" type="text" v-model.trim="branchName"
                                placeholder="最多输入20个字符">
                        </div>
                        <p class="redFont mf_89" v-show="isRedbranchName == true">{{branchNameText}}</p>
                        <div class="directorSelect">
                            <span>设置主管：</span>
                            <div id="directorSelect-rights" :class="{redInput:isRedbranchdirector}" @click="setDirectorClick(1)">
                                <ul>
                                    <li v-for="(item,index) in branchdirectors" :key="index">
                                        <div>{{item.adminName}}</div>
                                        <div class="xicon" @click.stop="delbranchDirector(index)">
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <p class="redFont mf_89" v-show="isRedbranchdirector == true">主管不能为空</p>
                    </div>
                    <div class="companyGroup">
                        <div class="font_16">部门企业群
                            <span class="created" v-show="iscreatemsg == 1">√已创建</span>
                        </div>
                        <div class="dissolutionGroup" v-show="iscreatemsg == 1" @click="dissolutionGroupClick">解散该群</div>
                    </div>
                    <div class="companyGroupDetail" v-show="iscreatemsg == 1">
                        <div>自动添加群成员</div>
                        <div @click="branchOpenClick">
                            <div v-show="branchOpen == true">
                                <span>开启</span>
                                <img src="/static/img/iconfont_page_open.png" alt="">
                            </div>
                            <div v-show="branchOpen == false">
                                <span>关闭</span>
                                <img src="/static/img/iconfont_page_colse.png" alt="">
                            </div>
                        </div>
                    </div>
                    <div class="newcomer" v-show="iscreatemsg == 1">有新人加入时会自动加入此群</div>
                    <div class="newcomer" v-show="iscreatemsg == 0" id="nogroupBranch">暂时没有群聊
                        <a @click="createGroupClick">创建群聊</a>
                    </div>
                </div>
                <div class="modalLeftfoot modalLeftfootBranch">
                    <p id="noDelTip" v-show="departmentListSlice.length > 0 || dataLists.length > 0 ">该部门下有子部门或人员不能删除</p>
                    <el-button type="primary" size="medium" @click="editBranchSave">保存</el-button>
                    <el-button type="info" size="medium" :disabled="departmentListSlice.length > 0 || dataLists.length > 0" @click="editBranchDel">删除</el-button>
                    <el-button type="info" size="medium" @click="cancle">取消</el-button>
                </div>
            </div>
        </div>
        <!--添加/编辑成员-->
        <div class="ModalsBox" v-show="setMember">
            <div class="ModalsLeft">
                <div class="modalsLeftTop">
                    {{setMemberTitle}}
                </div>
                <div class="ModalsLeftMain ModalsLeftMainCompany">
                    <div class="companyInfo">
                        <div class="font_16">手机端展示信息</div>
                        <div class="dissolutionGroup" @click="custom">自定义手机端展示</div>
                    </div>
                    <div class="MobileDetail">
                        <div>
                            <span>
                                <i class="mustIcon">*</i>姓名</span>：
                            <input :class="{redInput:isRedmemberName}" maxlength="20" type="text" v-model.trim="memberName">
                        </div>
                        <p class="redFont" v-show="isRedmemberName == true">{{addMemberName}}</p>
                        <div class="directorSelect">
                            <span>
                                <i class="mustIcon">*</i>部门</span>：
                            <div :class="{redInput:isRedbranchMember}" @click="setDirectorClick(3)">
                                <ul>
                                    <li v-for="(item,index) in branchMembers" :key="index">
                                        <div>{{item.adminName}}</div>
                                        <div class="xicon" @click.stop="delbranchMember(index)">
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <p class="redFont" v-show="isRedbranchMember == true">部门不能为空</p>
                        <div>
                            <span>邮箱</span>：
                            <input :class="{redInput:isRedmemberEmail}" maxlength="100" type="text" v-model.trim="memberEmail">
                        </div>
                        <p class="redFont" v-show="isRedmemberEmail == true">请输入正确的邮箱</p>
                        <div v-for="(item,index) in MobileVisibles" class="hideLable" :key="index">
                            <span :title="item.chnName">
                                <i class="mustIcon" v-show="item.chnName == '手机号'">*</i>
                                {{item.chnName}}
                            </span>：
                            <input maxlength="20" :disabled="item.isPhoneLive" :class="{redInput:item.status}" type="text" v-model.trim="item.value">
                            <p v-show="item.isPhoneLive && activityStatusTrue == 1" class="activityMember">此成员已激活，不可编辑</p>
                            <p v-show="item.isPhoneLive && activityStatusTrue == 0" class="activityMember">此成员未激活，不可编辑</p>
                            <p class="redFont" v-show="item.status == true">{{tips}}</p>
                        </div>
                    </div>
                    <div class="companyGroup">
                        <div class="font_16">手机端隐藏信息</div>
                        <div></div>
                    </div>
                    <div v-for="(iten,index) in MobileHides" class="hideLable" :key="index">
                        <span :title="iten.chnName">
                            <i class="mustIcon" v-show="iten.chnName == '手机号'">*</i>{{iten.chnName}}</span>：
                        <input maxlength="20" :disabled="iten.isPhoneLive" :class="{redInput:iten.status}" type="text" v-model.trim="iten.value">
                        <p v-show="iten.isPhoneLive && activityStatusTrue == 0" class="activityMember">此成员已激活，不可编辑</p>
                        <p v-show="iten.isPhoneLive && activityStatusTrue == 1" class="activityMember">此成员未激活，不可编辑</p>
                        <p class="redFont" v-show="iten.status == true">{{tips}}</p>
                    </div>
                </div>
                <div class="modalLeftfoot modalLeftfootMember">
                    <!-- <input type="button" value="保存并添加" @click="addMemberSaveAndadd" v-show="setMemberTitle == '添加成员'"> -->
                    <el-button type="primary" size="medium" @click="addMemberSave" v-show="setMemberTitle == '添加成员'">保存</el-button>
                    <el-button type="primary" size="medium" @click="amendMemberSave" v-show="setMemberTitle == '编辑成员'">保存</el-button>
                    <el-button type="info" size="medium" @click="delMember" v-show="setMemberTitle == '编辑成员'">删除</el-button>
                    <el-button type="info" size="medium" @click="cancle">取消</el-button>
                </div>
            </div>
        </div>
        <!--删除子公司弹出框-->
        <div v-show="delBoxChildCompany" class="delBox">
            <div class="delContent">
                <vue-del @ok="okClickChildCompany" @canle="canleClick" :name="titlename"></vue-del>
            </div>
        </div>
        <!--删除公司弹出框-->
        <div v-show="delBoxCompany" class="delBox">
            <div class="delContent">
                <vue-del @ok="okClickCompany" @canle="canleClick" :name="titlenameCompany"></vue-del>
            </div>
        </div>
        <!--删除部门弹出框-->
        <div v-show="delBoxBranch" class="delBox">
            <div class="delContent">
                <vue-del @ok="okClickBranch" @canle="canleClick" :name="titlenameBranch"></vue-del>
            </div>
        </div>
        <!--删除部门人员弹出框-->
        <div v-show="delBoxMember" class="delBox">
            <div class="delContent">
                <vue-del @ok="okClickMember" @canle="canleClick" :name="titlenameMember"></vue-del>
            </div>
        </div>
        <!--批量删除部门人员弹出框-->
        <div v-show="delBoxMemberBatch" class="delBox">
            <div class="delContent">
                <vue-del @ok="okClickMemberBatch" @canle="canleClick" :name="titlenameMemberBatch"></vue-del>
            </div>
        </div>
        <!--弹出框选择部门人员组件-->
        <div v-show='ModalsShow' class="ModalsmemBox">
            <div class="Modalsmem">
                <div class="ModalsmemTop">
                    {{selectBranchTitle}}
                </div>
                <div class="ModalsmemCenter">
                    <div class="centerLeft">
                        <div class="centerLeftTop">
                            {{selectBranchTitle}}
                        </div>
                        <div class="centerLeftBot">
                            <div class="centerLeftBotOne">
                                <div v-show="selectBranchTitle == '选择人员' || selectBranchTitle == '选择人员或部门'">
                                    <div class="centerLeftBotOneL">
                                        <img src="/static/img/watchsee.png" alt="">
                                    </div>
                                    <div class="centerLeftBotOneI">
                                        <input type="text" placeholder="搜索" v-model.trim="searchsmemVal">
                                    </div>
                                    <div v-show="searchsmemVal != ''" class="centerLeftBotOneX" @click="clearSearchClick">
                                        <img src="/static/img/Group.png" alt="">
                                    </div>
                                </div>
                            </div>
                            <div class="centerLeftBotTwo">
                                <ul>
                                    <li v-show='selectBranchTitle == "选择部门"' @click="navssClick()">
                                        <div>
                                        </div>
                                        <div class="centerLeftBotTwoFontblue">
                                            通讯录
                                        </div>
                                    </li>
                                    <li v-for="(item,index) in navLists" :key="index" @click="navClick(index)">
                                        <span v-show="index == 0 && selectBranchTitle == '选择部门'">
                                            >
                                        </span>
                                        <div v-show="index !== 0">
                                            >
                                        </div>
                                        <div class="centerLeftBotTwoFontblue">
                                            {{item.name}}
                                        </div>
                                    </li>
                                </ul>
                            </div>
                            <div class="centerLeftBotThr">
                                <div>
                                    <el-checkbox v-model="checkedDesign" @change="numChangeDesign"></el-checkbox>
                                </div>
                                <div>
                                    <span>全选</span>
                                </div>
                            </div>
                            <div class="centerLeftBotFour">
                                <ul>
                                    <li v-for="(item,index) in selectLeftlists" :key="index">
                                        <div class="centerLeftBotFourLiL" @click="lefthandleCheckedCitiesChange(index)">
                                            <div v-show="item.type == 1 && (selectBranchTitle == '选择部门' || selectBranchTitle == '选择人员或部门')">
                                                <img v-show="item.open" src="/static/img/on@2x.png" alt="">
                                                <img v-show="!item.open" src="/static/img/out@2x.png" alt="">
                                            </div>
                                            <div v-show="item.type == 2 && (selectBranchTitle == '选择人员' || selectBranchTitle == '选择人员或部门')">
                                                <img v-show="item.open" src="/static/img/on@2x.png" alt="">
                                                <img v-show="!item.open" src="/static/img/out@2x.png" alt="">
                                            </div>
                                            <div v-show="item.type == 1">
                                                <img src="/static/img/member@2x.png" alt="">
                                            </div>
                                            <div :title="item.name" :class="{grayColor:item.isAuth == 0}">
                                                {{item.name}}-{{item.type | typeFun}}
                                            </div>
                                        </div>
                                        <div v-if="item.type == 1" class="centerLeftBotFourLiR" @click="leftNextClick(index)">
                                            <div>
                                                <img src="/static/img/can@2x.png" alt="">
                                            </div>
                                            <div>
                                                下级
                                            </div>
                                        </div>
                                        <div v-else class="centerLeftBotFourLiR">
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="centerCenter">
                        <div @click="commodityLeftClick">
                            <img src="/static/img/xright@2x.png" alt="">
                        </div>
                        <div @click="commodityRightClick">
                            <img src="/static/img/xleft@2x.png" alt="">
                        </div>
                    </div>
                    <div class="centerRight">
                        <div class="centerRightTop">
                            {{selectBranchTitleAlready}}
                        </div>
                        <div class="centerRightBot">
                            <ul>
                                <li v-for="(item,index) in selectRightlists" :key="index" @click="righthandleCheckedCitiesChange(index)">
                                    <div class="centerRightBotLiL">
                                        <div>
                                            <img v-show="item.open" src="/static/img/on@2x.png" alt="">
                                            <img v-show="!item.open" src="/static/img/out@2x.png" alt="">
                                        </div>
                                        <div v-show="item.type == 1">
                                            <img src="/static/img/member@2x.png" alt="">
                                        </div>
                                        <div :title="item.name">
                                            {{item.name}}-{{item.type | typeFun}}
                                        </div>
                                    </div>
                                    <div class="centerRightBotLiR">
                                        <div>
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="ModalsmemBot">
                    <el-button type="primary" size="medium" @click="confirmClick">确认</el-button>
                    <el-button type="info" size="medium" @click="cancelClick">取消</el-button>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import vueDel from "./del.vue";
import vueZtree from "./vue-ztree.vue";
import industry from "../../assets/industry";
import draggable from "vuedraggable";
import { mapActions, mapState } from "vuex";
var mainOverflow = document.getElementById("mainOverflow");
export default {
  name: "set",
  components: {
    vueZtree,
    vueDel,
    draggable
  },
  data() {
    return {
      activityStatusTrue: false,
      root: "0", //总公司标识
      genSelectDomId: "", //跟部门id
      genSelectDomName: "", //跟部门name
      ztreeDataSource: [], //树形数组，
      dataList: [], //标题下面的导航
      checkList: [],
      isAuthority: true, //操作权限
      searchsmemVal: "", //选择人员团出框/搜索关键字
      selectBranchTitle: "",
      selectBranchTitleAlready: "已选人员",
      branchNameText: "请输入部门名称",
      managerNameText: "请输入管理员姓名",
      managerPhoneText: "请输入手机号码",
      BigcompanyNameText: "请输入子公司名称",
      addMemberName: "请输入姓名",
      batchTrue: false,
      addTrue: false,
      selectDomName: "", //部门名称
      titlenameMemberBatch: "确定批量删除成员吗？",
      delBoxMemberBatch: false,
      keywordId: "",
      random: "",
      tips: "不能输入特殊字符",
      isRedmemberPosition: false,
      memberPosition: "", //添家人员职位
      businessName: "", // 标题名称
      delBoxChildCompany: false,
      titlename: "确定要删除子公司吗？",
      delBoxCompany: false,
      titlenameCompany: "确定要删除公司吗？",
      delBoxBranch: false,
      titlenameBranch: "确定要删除该部门吗？",
      delBoxMember: false,
      titlenameMember: "确定要删除该成员吗？",
      isReddirector: false,
      isBigcompanyName: false,
      isRedmanagerName: false,
      isRedmanagerPhone: false,
      addCompanyTitle: false,
      treeDeepCopy: [],
      show: true,
      companyList: [], //所有子部门
      companyListSlice: [], //当前展示的子部门
      departmentListSlice: [], //当前展示下级部门列表
      departmentList: [], //所有下级部门列表
      dataLists: [], //成员列表
      checked: false, //成员列表全选
      setBusiness: false,
      BigcompanyName: "",
      ParentcompanyName: "",
      setChildrenBusiness: false,
      isRedselectedAreaone: false,
      isRedselectedAreatwo: false,
      isRedselectedTrade: false,
      selectedAreaone: 0,
      selectedAreaones: [{ name: "请选择", id: 0 }],
      selectedAreatwo: 0,
      selectedAreatwos: [{ name: "请选择", id: 0 }],
      selectedTrade: 0,
      selectedTrades: industry,
      managerName: "",
      managerPhone: "",
      directors: [], //公司主管列表
      setBranch: false,
      superBranch: "", //上级部门
      branchName: "",
      isRedbranchName: false,
      seteditBranch: false, //编辑部门弹出框开关
      branchdirectors: [], //部门主管
      isRedbranchdirector: false,
      visibleMans: [], //部门可见人
      dragLi: false, //下级部门排序
      selectBranch: "",
      isBranch: false, //是否企业群
      setMember: false,
      memberName: "",
      memberEmail: "",
      MobileVisibles: [],
      MobileHides: [],
      setMemberTitle: "添加成员",
      isRedmemberName: false,
      branchMembers: [],
      isRedbranchMember: false,
      isRedmemberEmail: false,
      isRedmemberPhone: false,
      memberPhone: "", //添加成员电话号
      MobileHidesStatus: false,
      MobileVisiblesStatus: false,
      isactiveLi: 1111111111,
      dragLiMember: false,
      memberIdArr: "", //成员id数组
      companyOpen: true, //自动添加群成员是否开启
      branchOpen: false, //群是否开启
      hideBranchOpen: true, //当前部门状态
      searchDatas: [], //全局搜索成员后的列表
      isSearchList: false,
      isnoSearchList: false,
      now: -1,
      keyword: "", //全局所搜成员关键字
      iscreatemsgCompany: "", //企业群
      selectDomId: "", //当前部门id
      selectDomParentId: "", //当前部门父id
      newBranchName: "",
      iscreatemsg: "", //部门群标记    /1-群已创建  /0-群还没有创建
      isBranchGroup: "", //群标记    /1-群已创建  /0-群还没有创建
      isgraybutStyle: false,
      isgraybutStyle_1: false, //调整部门/调整排序/批量删除 的样式
      childOid: "",
      selectUserId: "", //成员id
      adminId: "",
      iscreatemsgCompany: "", //有新成员时自动加入此群
      isCompanyGroup: "",
      parentOrgName: "", //标题名称
      isOnceAddChild: true,
      // *************组件样式*****
      checkedDesign: false,
      ModalsShow: false,
      navLists: [],
      selectLeftlists: [], //选择人员/部门弹出框
      selectRightlists: [], //选择人员/部门弹出框（已选）
      issetBranchDirector: "",
      selectMembersVal_1: [],
      selectMembersVal_2: [],
      selectMembersVal_3: [],
      selectMembersVal_4: [],
      selectMembersVal_5: [],
      ischeckedDesignBranch: false,
      upShow: true, //下一级 请求判断
      editBranchShow: false //判断是否为修改部门
    };
  },
  filters: {
    typeFun: function(val) {
      if (val == 1) {
        return "部门";
      } else {
        return "人员";
      }
    },
    nameFun: function(val) {
      if (val) {
        if (val.length > 2) {
          return val.slice(val.length - 2);
        } else {
          return val;
        }
      }
    }
  },
  created: function() {
    var self = this;
    var accessToken = sessionStorage.getItem("accessToken");
    if (accessToken) {
    } else {
      var warningStr = "没有登录不允许访问,点击确定跳转登录页面";
      this.$alert(warningStr, "提示", {
        confirmButtonText: "确定",
        type: "info"
      })
        .then(() => {
          this.$router.push({
            path: "/login"
          });
        })
        .catch(() => {
          this.$router.push({
            path: "/login"
          });
        });
    }
    self
      .getbookapibookselectcompanytree({
        companyId: sessionStorage.getItem("ORGID")
      })
      .then(data => {
        if (data.statusCode == "200") {
          if (data.data.companyVo) {
            self.iscreatemsgCompany = data.data.companyVo.isOpenGroup; //是否创建群聊
            self.root = data.data.companyVo.root;
            self.parentOrgName = data.data.companyVo.parentName;
          }
        } else {
          self.$message(data.statusMessage);
        }
      })
      .catch(msg => {
        this.$message({
          type: "info",
          message: "服务器异常"
        });
      });
    this.getRegion(0); //获取地区信息
    this.getOrgTree(); //获取树形
    this.getChildCompany(); //获取子公司
  },
  mounted() {},
  watch: {
    searchsmemVal: function(val) {
      var self = this;
      self.selectLeftlists = [];
      if (val.length == 0) {
        if (self.selectBranchTitle == "选择人员") {
          self.listFun(1);
        } else {
          self.listFun(0);
        }
      } else {
        self
          .getmembermemberquery({
            companyId: sessionStorage.getItem("ORGID"),
            deptId: self.selectDomId,
            queryName: val
          })
          .then(data => {
            if (data.statusCode == "200") {
              if (data.data) {
                data.data.forEach(function(ele, ind) {
                  self.selectLeftlists.push({
                    name: ele.memberName,
                    open: false,
                    type: 2,
                    id: ele.memberId
                  });
                });
                // 点击数组更新后，循环遍历与右侧进行对比是否选中
                self.selectLeftlists.forEach(function(eleLeft, eleLeftInd) {
                  self.selectRightlists.forEach(function(eleRight, rightInd) {
                    if (eleLeft.id == eleRight.id) {
                      self.selectLeftlists[eleLeftInd].open = true;
                    }
                  });
                });
                self.judgeSelectAll();
              }
            } else {
              self.$message({
                type: "info",
                message: data.statusMessage
              });
            }
          })
          .catch(msg => {
            this.$message({
              type: "info",
              message: "服务器异常"
            });
          });
      }
    }
  },

  methods: {
    //导航 通讯录点击
    navssClick() {
      this.navLists = [];
      this.selectLeftlists = [
        {
          name: this.genSelectDomName,
          open: false,
          parentId: "",
          type: 1,
          id: this.genSelectDomId
        }
      ];
      this.judgeSelectAll();
      var self = this;
      self.selectLeftlists.forEach(function(eleLeft, eleLeftInd) {
        self.selectRightlists.forEach(function(eleRight, rightInd) {
          if (eleLeft.id == eleRight.id) {
            self.selectLeftlists[eleLeftInd].open = true;
          }
        });
      });
      self.ModalsShow = true; //选择主管弹出框
    },
    listFun(m, n) {
      if (m == 0) {
        this.navLists = [];
        this.selectLeftlists = [
          {
            name: this.genSelectDomName,
            open: false,
            parentId: "",
            type: 1,
            id: this.genSelectDomId
          }
        ];
        return;
      } else {
        var self = this;
        self.selectLeftlists = [];
        this.getbookapibookselectdepttree({
          deptId: self.selectDomId
        })
          .then(data => {
            if (data.statusCode == "200") {
              if (self.dataList.length == 1) {
                self.navLists = [
                  { name: self.businessName, deptId: self.selectDomId }
                ];
              } else {
                self.navLists = [
                  { name: self.selectBranch, deptId: self.selectDomId }
                ];
              }
              if (data.data.deptUserList) {
                if (data.data.deptUserList.length) {
                  data.data.deptUserList.forEach(function(ele, ind) {
                    self.selectLeftlists.push({
                      name: ele.memberName,
                      open: false,
                      type: 2,
                      id: ele.memberId
                    });
                  });
                }
                self.selectRightlists = [];
                if (n == 1) {
                  if (self.branchdirectors.length > 0) {
                    self.branchdirectors.forEach(function(ele, index) {
                      self.selectRightlists.push({
                        name: ele.adminName,
                        id: ele.adminId,
                        open: false,
                        type: 2
                      });
                    });
                  }
                } else if (n == 0) {
                  if (self.directors.length > 0) {
                    self.directors.forEach(function(ele, index) {
                      self.selectRightlists.push({
                        name: ele.adminName,
                        id: ele.adminId,
                        open: false,
                        type: 2
                      });
                    });
                  }
                }
                self.selectLeftlists.forEach(function(ele, index) {
                  ele.open = false;
                });
                if (self.selectRightlists.length > 0) {
                  for (var i = 0; i < self.selectLeftlists.length; i++) {
                    for (var j = 0; j < self.selectRightlists.length; j++) {
                      self.selectRightlists[j].open = false;
                      if (
                        self.selectLeftlists[i].id ==
                        self.selectRightlists[j].id
                      ) {
                        self.selectLeftlists[i].open = true;
                      }
                    }
                  }
                }
              }
              self.judgeSelectAll();
              self.ModalsShow = true; //选择主管弹出框
            } else {
              self.$message(data.statusMessage);
            }
          })
          .catch(msg => {
            self.$message({
              type: "info",
              message: "服务器异常"
            });
          });
      }
    },
    // 选择部门弹出框导航点击
    navClick(index) {
      var self = this;
      self
        .getbookapibookselectdepttree({
          deptId: self.navLists[index].deptId
        })
        .then(data => {
          if (data.statusCode == "200") {
            self.selectLeftlists = [];
            var start = index + 1;
            self.navLists.splice(index + 1, self.navLists.length - start);
            // 如果是公司走这里
            if (self.selectBranchTitle == "选择部门") {
              if (data.data.deptList) {
                data.data.deptList.forEach(function(ele, ind) {
                  self.selectLeftlists.push({
                    name: ele.name,
                    open: false,
                    parentId: ele.parentId,
                    type: 1,
                    id: ele.id
                  });
                });
              }
            } else if (self.selectBranchTitle == "选择人员") {
              if (data.data.deptUserList) {
                data.data.deptUserList.forEach(function(ele, ind) {
                  self.selectLeftlists.push({
                    name: ele.memberName,
                    open: false,
                    type: 2,
                    id: ele.memberId
                  });
                });
              }
            } else {
              if (data.data) {
                data.data.forEach(function(ele, ind) {
                  self.selectLeftlists.push({
                    name: ele.name,
                    open: false,
                    parentId: ele.parentId,
                    type: ele.type,
                    id: ele.id,
                    isAuth: ele.isAuth
                  });
                });
              }
            }
            // 点击数组更新后，循环遍历与右侧进行对比是否选中
            if (self.selectLeftlists) {
              if (self.selectLeftlists.length > 0) {
                self.selectLeftlists.forEach(function(eleLeft, eleLeftInd) {
                  self.selectRightlists.forEach(function(eleRight, rightInd) {
                    if (eleLeft.id == eleRight.id) {
                      self.selectLeftlists[eleLeftInd].open = true;
                    }
                  });
                });
              }
            }
            self.judgeSelectAll();
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          self.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 下一级
    leftNextClick(index) {
      var self = this;
      if (self.upShow == true) {
        self.upShow = false;
        self
          .getbookapibookselectdepttree({
            deptId: self.selectLeftlists[index].id
          })
          .then(data => {
            if (data.statusCode == "200") {
              self.navLists.push({
                name: self.selectLeftlists[index].name,
                deptId: self.selectLeftlists[index].id
              });
              self.selectLeftlists = [];
              if (self.selectBranchTitle == "选择部门") {
                if (data.data.deptList) {
                  data.data.deptList.forEach(function(ele, ind) {
                    self.selectLeftlists.push({
                      name: ele.name,
                      open: false,
                      parentId: ele.parentId,
                      type: 1,
                      id: ele.id
                    });
                  });
                }
              } else {
                if (data.data.deptList) {
                  data.data.deptUserList.forEach(function(ele, ind) {
                    self.selectLeftlists.push({
                      name: ele.name,
                      open: false,
                      parentId: ele.parentId ? ele.parentId : "",
                      type: 1,
                      id: ele.id
                    });
                  });
                }
              }
              self.selectLeftlists.forEach(function(eleLeft, eleLeftInd) {
                self.selectRightlists.forEach(function(eleRight, rightInd) {
                  if (eleLeft.id == eleRight.id) {
                    self.selectLeftlists[eleLeftInd].open = true;
                  }
                });
              });
              self.judgeSelectAll();
            } else {
              self.$message(data.statusMessage);
            }
            self.upShow = true;
          })
          .catch(msg => {
            self.upShow = true;
            this.$message({
              type: "info",
              message: "服务器异常"
            });
          });
      }
    },
    // 取消选中商品
    righthandleCheckedCitiesChange(index) {
      var self = this;
      this.selectRightlists[index].open = !this.selectRightlists[index].open;
    },
    // 点击向左移动按钮
    commodityRightClick() {
      var self = this;
      var rights = [];
      var seRight = [];
      self.selectRightlists.forEach(function(ele, ind) {
        if (ele.open == false) {
          rights.push({
            name: ele.name,
            open: false,
            parentId: ele.parentId,
            type: ele.type,
            id: ele.id
          });
        } else {
          seRight.push({
            name: ele.name,
            open: false,
            parentId: ele.parentId,
            type: ele.type,
            id: ele.id
          });
        }
      });
      self.selectRightlists = rights;
      this.selectLeftlists.forEach(function(eleL, indL) {
        seRight.forEach(function(ele, ind) {
          if (eleL.id === ele.id) {
            self.selectLeftlists[indL].open = false;
          }
        });
      });
      this.selectLeftlists.forEach(function(eleL, indL) {
        rights.forEach(function(ele, ind) {
          if (eleL.id === ele.id) {
            self.selectLeftlists[indL].open = true;
          }
        });
      });
      this.judgeSelectAll();
    },
    // 判断是否全选
    judgeSelectAll() {
      var rArrs = [];
      this.selectLeftlists.forEach(function(ele, ind) {
        if (ele.open == true) {
          rArrs.push(ind);
        }
      });
      if (rArrs.length == this.selectLeftlists.length && rArrs.length !== 0) {
        this.checkedDesign = true;
      } else {
        this.checkedDesign = false;
      }
    },
    // 添加选中商品
    lefthandleCheckedCitiesChange(index) {
      var self = this;
      if (this.selectBranchTitle == "选择部门") {
        if (self.selectLeftlists[index].isAuth == 0) {
          //   this.selectLeftlists[index].open = this.selectLeftlists[index].open;
        } else {
          this.selectLeftlists[index].open = !this.selectLeftlists[index].open;
        }
      } else if (this.selectBranchTitle == "选择人员") {
        if (this.selectLeftlists[index].type == 2) {
          this.selectLeftlists[index].open = !this.selectLeftlists[index].open;
        }
      } else if (this.selectBranchTitle == "选择人员或部门") {
        if (
          self.selectLeftlists[index].isAuth == 0 &&
          self.selectLeftlists[index].type == 1
        ) {
          //   this.selectLeftlists[index].open = this.selectLeftlists[index].open;
        } else {
          this.selectLeftlists[index].open = !this.selectLeftlists[index].open;
        }
      }
      this.judgeSelectAll();
    },
    // 点击向右移动
    commodityLeftClick() {
      var self = this;
      var rArrs = [];
      this.selectLeftlists.forEach(function(ele, ind) {
        if (ele.open == true) {
          self.selectRightlists.push({
            clickNode: ele.clickNode,
            name: ele.name,
            open: false,
            parentId: ele.parentId,
            type: ele.type,
            id: ele.id,
            isAuth: ele.isAuth
          });
        }
      });
      var hash = {};
      self.selectRightlists = self.selectRightlists.reduce(function(
        item,
        next
      ) {
        hash[next.id] ? "" : (hash[next.id] = true && item.push(next));
        return item;
      },
      []);
    },
    // 所有序号被选中时
    numChangeDesign(event) {
      var self = this;
      self.ischeckedDesignBranch = false;
      if (self.selectBranchTitle == "选择人员") {
        if (event) {
          this.selectLeftlists.forEach(function(ele, ind) {
            if (ele.type == 2) {
              ele.open = true;
            }
          });
        } else {
          this.selectLeftlists.forEach(function(ele, ind) {
            if (ele.type == 2) {
              ele.open = false;
            }
          });
        }
      } else if (self.selectBranchTitle == "选择部门") {
        if (event) {
          this.selectLeftlists.forEach(function(ele, ind) {
            if (ele.type == 1) {
              ele.open = true;
            }
          });
        } else {
          this.selectLeftlists.forEach(function(ele, ind) {
            if (ele.type == 1) {
              ele.open = false;
            }
          });
        }
      } else {
        self.selectLeftlists.forEach(function(ele, ind) {
          if (ele.isAuth == 0 && ele.type == 1) {
            self.ischeckedDesignBranch = true;
          }
        });
        if (self.ischeckedDesignBranch == true) {
          self.checkedDesign = false;
          self.$message("不能选择没有权限的部门！");
        } else {
          if (event.target.checked) {
            this.selectLeftlists.forEach(function(ele, ind) {
              ele.open = true;
            });
          } else {
            this.selectLeftlists.forEach(function(ele, ind) {
              ele.open = false;
            });
          }
        }
      }
    },
    //选择成员弹出框确认
    confirmClick() {
      var val = "";
      var arr = this.selectRightlists.map(function(data) {
        return { adminName: data.name, adminId: data.id, type: data.type };
      });
      // 添加公司设置主管
      if (this.setBusiness == true) {
        this.ModalsShow = false;
        this.directors = [];
        for (var i = 0; i < arr.length; i++) {
          this.directors.push(arr[i]);
        }
        this.selectMembersVal_1 = this.directors.map(function(data) {
          return data.adminId;
        });
      } else if (
        this.seteditBranch == true &&
        this.issetBranchDirector == "1"
      ) {
        // 添加部门设置主管
        this.ModalsShow = false;
        this.branchdirectors = [];
        for (var i = 0; i < arr.length; i++) {
          this.branchdirectors.push(arr[i]);
        }
        this.selectMembersVal_2 = this.branchdirectors.map(function(data) {
          return data.adminId;
        });
      } else if (
        this.seteditBranch == true &&
        this.issetBranchDirector == "2"
      ) {
        this.ModalsShow = false;
        // 编辑部门设置可见人
        this.visibleMans = [];
        for (var i = 0; i < arr.length; i++) {
          this.visibleMans.push(arr[i]);
        }
        this.selectMembersVal_3 = this.visibleMans.map(function(data) {
          return { id: data.adminId, type: data.type };
        });
      } else if (this.issetBranchDirector == "3") {
        // 添加人员设置部门
        this.ModalsShow = false;
        this.branchMembers = [];
        for (var i = 0; i < arr.length; i++) {
          this.branchMembers.push(arr[i]);
        }
        this.selectMembersVal_5 = this.branchMembers.map(function(data) {
          return data.adminId;
        });
      } else {
        // 调整人员部门
        var arrAdjustBrnch = [];
        for (var i = 0; i < arr.length; i++) {
          arrAdjustBrnch.push(arr[i]);
        }
        this.selectMembersVal_4 = arrAdjustBrnch.map(function(data) {
          return data.adminId;
        });
        if (this.selectMembersVal_4.length == 0) {
          this.$message("请选择要调整的部门！");
          return;
        }
        this.ModalsShow = false;
        var self = this;
        // 调整人员部门
        self
          .getmemberuseradjustdept(
            JSON.stringify({
              orgId: sessionStorage.getItem("ORGID"), //企业ID
              memberId: sessionStorage.getItem("memberId"), //企业成员ID
              currentDeptId: self.selectDomId, //当前部门id
              targetUserIdArray: self.memberIdArr.split(","), //调整人员id
              targetDeptIdArray: self.selectMembersVal_4 //调整部门id
            })
          )
          .then(data => {
            if (data.statusCode == "200") {
              self.getOrgTree();
              self.$message({
                type: "success",
                message: "调整部门操作成功！"
              });
            } else {
              self.$message(data.statusMessage);
            }
          })
          .catch(msg => {
            this.$message({
              type: "info",
              message: "服务器异常"
            });
          });
      }
    },
    // 选择成员弹出框取消
    cancelClick() {
      this.ModalsShow = false;
    },
    // 调整部门
    adjustBranch() {
      if (this.dataLists.length == 0) {
        this.$message("没有人员无法调整");
        return;
      } else {
        if (this.checkList.length == 0) {
          this.$message("请选择人员");
        } else {
          mainOverflow.style.overflowY = "hidden";
          this.checkedDesign = false; //弹出框的全选取消
          this.ModalsShow = true;
          this.selectBranchTitle = "选择部门";
          this.selectBranchTitleAlready = "已选部门";
          this.selectRightlists = [];
          this.selectLeftlists = [];
          this.issetBranchDirector = "";
          this.listFun(0);
        }
      }
    },
    // **************************************************************************
    // 点击设置主管
    setDirectorClick(m) {
      var self = this;
      self.checkedDesign = false;
      self.selectRightlists = [];
      self.searchsmemVal = "";
      mainOverflow.style.overflowY = "hidden";
      self.selectLeftlists = [];
      self.navLists = [];
      if (m == 1) {
        //添加部门设置主管
        self.listFun(1, 1);
        self.selectBranchTitle = "选择人员";
        self.selectBranchTitleAlready = "已选人员";
        self.issetBranchDirector = "1";
      } else if (m == 2) {
        self.listFun(0);
        //添加部门设置可见人
        self.selectBranchTitle = "选择人员或部门";
        self.selectBranchTitleAlready = "已选人员或部门";
        self.issetBranchDirector = "2";
        if (self.visibleMans.length > 0) {
          self.visibleMans.forEach(function(ele, index) {
            self.selectRightlists.push({
              name: ele.adminName,
              id: ele.adminId,
              open: false,
              type: ele.type
            });
          });
          self.selectLeftlists.forEach(function(ele, index) {
            ele.open = false;
          });
          self.selectLeftlists.forEach(function(eleLeft, eleLeftInd) {
            self.selectRightlists.forEach(function(eleRight, rightInd) {
              if (eleLeft.id == eleRight.id) {
                self.selectLeftlists[eleLeftInd].open = true;
              }
            });
          });
          self.judgeSelectAll();
          self.ModalsShow = true; //选择主管弹出框
        } else {
          self.selectRightlists = [];
          self.selectLeftlists.forEach(function(ele, index) {
            ele.open = false;
          });
        }
      } else if (m == 3) {
        //添加人员设置部门
        self.selectBranchTitle = "选择部门";
        self.selectBranchTitleAlready = "已选部门";
        self.issetBranchDirector = "3";
        if (self.branchMembers.length > 0) {
          self.branchMembers.forEach(function(ele, index) {
            self.selectRightlists.push({
              name: ele.adminName,
              id: ele.adminId,
              open: false,
              type: 1
            });
          });
          self.selectLeftlists.forEach(function(ele, index) {
            ele.open = false;
          });
          self.selectLeftlists.forEach(function(eleLeft, eleLeftInd) {
            self.selectRightlists.forEach(function(eleRight, rightInd) {
              if (eleLeft.id == eleRight.id) {
                self.selectLeftlists[eleLeftInd].open = true;
              }
            });
          });
        } else {
          self.selectRightlists = [];
          self.selectLeftlists.forEach(function(ele, index) {
            ele.open = false;
          });
        }
        self.navssClick();
        // self.ModalsShow = true;  //选择主管弹出框
      } else if (m == 4) {
        //添加公司主管
        self.listFun(1, 0);
        self.selectBranchTitle = "选择人员";
        self.selectBranchTitleAlready = "已选人员";
        self.issetBranchDirector = "";
      }
    },
    // 获取地区信息
    getRegion(num) {
      var self = this;
      self
        .getapisystemapiareagetarea({
          pid: num
        })
        .then(data => {
          if (data.statusCode == "200") {
            data.data.unshift({ id: 0, name: "请选择", pid: "0" });
            if (num == 0) {
              self.selectedAreaones = data.data;
            } else {
              self.selectedAreatwo = 0;
              self.selectedAreatwos = data.data;
            }
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 查看所有下级部门
    lookAlldepartment() {
      this.departmentListSlice = this.departmentList;
    },
    // 查看部分下级部门
    lookPartdepartment() {
      this.departmentListSlice = this.departmentList.slice(0, 10);
      this.dragLi = false;
    },
    // 查看所有子公司
    lookAllcompanyList() {
      this.companyListSlice = this.companyList;
    },
    // 查看部分子公司
    lookPartcompanyList() {
      this.companyListSlice = this.companyList.slice(0, 10);
    },
    // 获取子公司列表
    getChildCompany() {
      var self = this;
      self
        .getbookapibookcompanylist({
          companyId: sessionStorage.getItem("ORGID") //母公司编号？？？？？？？？？？？？？？？？？？？？？？？？？
        })
        .then(data => {
          if (data.statusCode == "200") {
            if (data.data) {
              if (data.data.length == 0) {
                self.dragLi = false;
              }
              self.companyList = data.data;
              self.companyListSlice = data.data.slice(0, 10);
            }
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 查找选中的那条数据的children
    mClickChild(data, id) {
      var self = this;
      for (var i = 0; i < data.length; i++) {
        if (id == data[i].id) {
          self.newBranchName = data[i].name;
          self.iscreatemsg = data[i].isCreateGroup;
          self.iscreatemsgCompany = data[i].isCreateGroup;
          self.departmentList =
            data[i].hasOwnProperty("childrenList") == true
              ? data[i].childrenList
              : [];
          return;
        }
        if (data[i].hasOwnProperty("childrenList")) {
          self.mClickChild(data[i].childrenList, id);
        }
      }
    },
    // 根据id查找部门名称
    seekBranchById(data, id) {
      var self = this;
      for (var i = 0; i < data.length; i++) {
        if (id == data[i].id) {
          self.superBranch = data[i].name;
          return;
        }
        if (data[i].hasOwnProperty("childrenList")) {
          self.seekBranchById(data[i].childrenList, id);
        }
      }
    },
    // 查找部门下的人员列表
    getBranchMember() {
      var self = this;
      self.dataLists = [];
      self
        .getbookapibookuserlist({
          deptId: self.selectDomId
        })
        .then(data => {
          if (data.statusCode == "200") {
            if (data.data) {
              self.dataLists = data.data;
              if (self.dataLists.length == 0) {
                self.isgraybutStyle_1 = true;
                self.dragLiMember = false;
              } else {
                self.isgraybutStyle_1 = false;
              }
            }
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          self.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 获取树形结构数据
    getOrgTree() {
      var self = this;
      self
        .getbookapibookselectbooktree({
          companyId: sessionStorage.getItem("ORGID"),
          memberId: sessionStorage.getItem("memberId"),
          appId: sessionStorage.getItem("getAppid") //通讯录id
        })
        .then(data => {
          if (data.statusCode == "200") {
            if (data.data) {
              self.genSelectDomId = data.data.id;
              self.genSelectDomName = data.data.name;
              if (data.data.name == undefined || data.data == {}) {
                return;
                this.$message("获取公司信息有误！");
              }
              self.ztreeDataSource = [data.data];
              // self.parentOrgName = self.ztreeDataSource[0].parentOrgName;
              self.businessName = this.ztreeDataSource[0].name;
              self.selectDomId = this.ztreeDataSource[0].id;
              if (sessionStorage.getItem("mClicks")) {
                //获取导航点击的部门
                var mClickData = JSON.parse(sessionStorage.getItem("mClicks"));
                // console.log("获取导航点击的部门", mClickData);
                self.selectDomId = mClickData.id;
                //点击下级部门列表
                self.mClickChild(self.ztreeDataSource, mClickData.id);
                // 根据选中的节点id,让其父级展开，并让自身加上背景色
                self.findselectId(self.ztreeDataSource, self.selectDomId);
                // 触发点击节点效果形成导航
                self.nodeClick(mClickData, "", self.ztreeDataSource);
              } else {
                data.data.isExpand = false;
                data.data.isFolder = true;
                data.data.loadNode = 0;
                var mClickData = data.data;

                //点击下级部门列表
                self.mClickChild(self.ztreeDataSource, self.selectDomId);
                // 根据选中的节点id,让其父级展开，并让自身加上背景色
                self.findselectId(self.ztreeDataSource, self.selectDomId);
                // 触发点击节点效果形成导航
                self.nodeClick(mClickData, "", self.ztreeDataSource);
              }
            }
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          self.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 确定删除公司
    okClickCompany() {
      var self = this;
      mainOverflow.style.overflowY = "auto";
      self.delBoxCompany = false;
      self
        .getcompanydeletechildrencompany({
          companyId: self.childOid
        })
        .then(data => {
          if (data.statusCode == "200") {
            mainOverflow.style.overflowY = "auto";
            self.delBoxCompany = self.setBusiness = false;
            sessionStorage.removeItem("mClicks");
            self.$message({
              type: "success",
              message: "删除公司成功！"
            });
            self.$router.push({
              path: "/login"
            });
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 确定删除部门
    okClickBranch() {
      var self = this;
      mainOverflow.style.overflowY = "auto";
      self.delBoxBranch = false;
      self
        .getbookapibookchildrendeptdelete({
          deptId: self.selectDomId
        })
        .then(data => {
          if (data.statusCode == "200") {
            self.seteditBranch = self.delBoxBranch = self.isBranch = false;
            mainOverflow.style.overflowY = "auto";
            sessionStorage.removeItem("mClicks");
            self.dataList = [];
            self.getOrgTree();
            self.$message({
              type: "success",
              message: "删除部门成功！"
            });
          } else {
            self.delBoxBranch = false;
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 确定删除成员
    okClickMember() {
      var self = this;
      mainOverflow.style.overflowY = "auto";
      self.delBoxMember = false;
      self
        .getmemberbatchdeletemember({
          companyId: sessionStorage.getItem("ORGID"),
          memberIds: self.selectUserId, //成员id
          deptId: self.selectDomId
        })
        .then(data => {
          if (data.statusCode == "200") {
            mainOverflow.style.overflowY = "auto";
            self.delBoxMember = self.setMember = false;
            self.getBranchMember();
            self.getOrgTree();
            self.$message({
              type: "success",
              message: "删除部门人员成功！"
            });
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    canleClick() {
      mainOverflow.style.overflowY = "auto";
      this.delBoxChildCompany = false;
      this.delBoxCompany = this.delBoxBranch = this.delBoxMember = this.delBoxMemberBatch = false;
    },
    cancle() {
      mainOverflow.style.overflowY = "auto";
      this.setBusiness = false;
      this.setChildrenBusiness = false;
      this.setBranch = false;
      this.seteditBranch = false;
      this.setMember = false;
      this.getOrgTree();
    },
    // 点击导航
    breadcrumbLiClick(index, item) {
      var self = this;
      if (index == this.dataList.length - 1) {
        return;
      }
      // 递归 //判断出当前点击的部门数组
      var recurFunc = data => {
        data.forEach(i => {
          if (i.id == item.id) {
            i.clickNode = true;
            sessionStorage.setItem("mClicks", JSON.stringify(i)); //存入当前点击的部门数组
            this.getOrgTree();
          } else {
            i.clickNode = false;
          }
          if (i.childrenList) {
            recurFunc(i.childrenList);
          }
        });
      };
      recurFunc(this.treeDeepCopy);
      self.dataList.splice(index + 1, self.dataList.length - (index + 1));
      var tree = Object.assign([], this.treeDeepCopy);
      this.ztreeDataSource = tree;
    },
    // 根据父级id查找数据形成导航
    findById(data, parentId) {
      var self = this;
      for (var i = 0; i < data.length; i++) {
        if (parentId == data[i].id) {
          self.dataList.push(data[i]);
          self.findById(self.ztreeDataSource, data[i].parentId);
          return data[i];
        }
        if (data[i].hasOwnProperty("childrenList")) {
          self.findById(data[i].childrenList, parentId);
        }
      }
    },
    // 由选中的那条数据通过parentID,让其父级都展开
    launch(data, parentId) {
      var vm = this;
      for (var i = 0; i < data.length; i++) {
        if (parentId == data[i].id) {
          data[i].open = true;
          data[i].clickNode = false;
          vm.launch(vm.ztreeDataSource, data[i].parentId);
          return;
        }
        if (data[i].hasOwnProperty("childrenList")) {
          vm.launch(data[i].childrenList, parentId);
        }
      }
    },
    // 根据id找到选中的那条数据标记它
    findselectId(data, id) {
      var vm = this;
      for (var i = 0; i < data.length; i++) {
        if (id == data[i].id) {
          data[i].open = true;
          data[i].clickNode = true;
          vm.launch(vm.ztreeDataSource, data[i].parentId);
          return;
        }
        if (data[i].hasOwnProperty("childrenList")) {
          vm.findselectId(data[i].childrenList, id);
        }
      }
    },
    // 点击节点
    nodeClick: function(m, parent, tree) {
      // console.log("点击节点", m);
      var self = this;
      if (self.editBranchShow == true) {
        m.name = self.branchName;
        self.editBranchShow = false;
      }
      self.selectDomParentId = m.parentId;
      self.selectDomName = m.name;
      self.checkList = [];
      self.checked = false;
      self.dragLiMember = self.dragLi = false;
      self.selectDomId = m.id;
      sessionStorage.setItem("mClicks", JSON.stringify(m));
      //   树结构添加权限
      if (m.isAuth == 0) {
        //判断有无权限
        self.isAuthority = false;
        return;
      } else {
        self.isAuthority = true;
      }
      self.treeDeepCopy = tree;
      self.departmentListSlice = self.departmentList = [];
      self.dataList = [];
      self.findById(self.ztreeDataSource, m.parentId);
      self.dataList = self.dataList.reverse();
      self.dataList.push(m);
      self.selectBranch = m.name;
      //获取部门
      self
        .getbookapibookdeptlist({
          deptId: self.selectDomId
        })
        .then(data => {
          if (data.statusCode == 200) {
            if (data.data) {
              if (data.data.childrenList) {
                self.departmentList = data.data.childrenList;
                if (self.departmentList.length == 0) {
                  self.isgraybutStyle = true;
                } else {
                  self.isgraybutStyle = false;
                }
                if (self.departmentList.length > 10) {
                  self.departmentListSlice = self.departmentList.slice(0, 10);
                } else {
                  self.departmentListSlice = self.departmentList;
                }
                // console.log("departmentListSlice", self.departmentListSlice);
              }
            }
          }
        })
        .catch(msg => {
          self.$message("服务器异常");
        });
      // 获取当前点击的部门下的人员
      self.getBranchMember();
      if (m.root == 0 || m.root == undefined) {
        //判断是不是总公司标识
        self.isBranch = true;
        //获取部门信息
        self
          .getbookapibookselectdepttree({
            deptId: self.selectDomId
          })
          .then(data => {
            if (data.statusCode == 200) {
              if (data.data.deptVo) {
                self.iscreatemsg = data.data.deptVo.isOpenGroup;
              }
            } else {
              self.$message(data.statusMessage);
            }
          })
          .catch(msg => {
            self.$message({
              type: "info",
              message: "服务器异常"
            });
          });
      } else {
        self.isBranch = false;
        //获取企业信息
        self
          .getbookapibookselectcompanytree({
            companyId: sessionStorage.getItem("ORGID")
          })
          .then(data => {
            if (data.statusCode == "200") {
              if (data.data.companyVo) {
                self.iscreatemsgCompany = data.data.companyVo.isOpenGroup; //是否创建群聊+
                self.root = data.data.companyVo.root;
                self.parentOrgName = data.data.companyVo.parentName;
              }
            } else {
              self.$message(data.statusMessage);
            }
          })
          .catch(msg => {
            self.$message({
              type: "info",
              message: "服务器异常"
            });
          });
      }
    },
    //阻止选择时冒泡没有操作
    checkClickStop() {},
    // 成员全选
    numChange(event) {
      this.checkList = event ? this.dataLists : [];
      var a = this.checkList.map(function(data) {
        return data.memberId;
      });
      this.memberIdArr = a.join(",");
    },
    //成员选择
    handleCheckedCitiesChange(value) {
      let checkedCount = value.length;
      this.checked = checkedCount === this.dataLists.length;
      var a = this.checkList.map(function(data) {
        return data.memberId;
      });
      this.memberIdArr = a.join(",");
    },
    // 设置公司  获取部门信息
    setBusinessClick() {
      this.isReddirector = false;
      this.selectBranchTitle = "选择人员";
      this.BigcompanyName = this.businessName;
      this.isRedbranchdirector = false;
      //获取企业信息
      var self = this;
      self.directors = [];
      self
        .getbookapibookselectcompanytree({
          companyId: sessionStorage.getItem("ORGID")
        })
        .then(data => {
          if (data.statusCode == "200") {
            if (data.data.deptVo.managerList) {
              if (data.data.deptVo.managerList.length > 0) {
                data.data.deptVo.managerList.forEach(function(ele, ind) {
                  self.directors.push({
                    adminName: ele.managerName,
                    adminId: ele.managerId
                  });
                });
              }
            }
            self.companyOpen =
              data.data.companyVo.isAutoGroupUser == 0 ? false : true; //是否打开自动添加
            self.iscreatemsgCompany = data.data.companyVo.isOpenGroup; //是否创建群
            self.isCompanyGroup = data.data.companyVo.isOpenGroup;
            self.setBusiness = true; //打开弹出框
            mainOverflow.style.overflowY = "hidden";
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 编辑公司删除管理员
    delDirector(index) {
      this.directors.splice(index, 1);
      this.selectMembersVal_1 = this.directors.map(function(data) {
        return data.adminId;
      });
    },
    // 编辑公司保存
    bigCompantSave() {
      if (this.directors.length == 0) {
        //directors主管列表
        this.isReddirector = true;
      } else {
        var self = this;
        var commitData;
        var directorsId = [];
        this.directors.forEach(function(ele, ind) {
          directorsId.push(ele.adminId);
        });
        commitData = {
          companyId: sessionStorage.getItem("ORGID"),
          managerIds: directorsId, //主管id逗号隔开
          isCreateGroup: self.isCompanyGroup == 1 ? 0 : self.iscreatemsgCompany,
          isAutoGroupUser: self.companyOpen == false ? 0 : 1,
          isDisbandGroup:
            self.isCompanyGroup == 0 ? 0 : self.iscreatemsgCompany == 0 ? 1 : 0,
          memberId: sessionStorage.getItem("memberId")
        };
        self
          .getcompanymodifycompany(JSON.stringify(commitData))
          .then(data => {
            if (data.statusCode == "200") {
              self.setBusiness = false;
              mainOverflow.style.overflowY = "auto";
              self.getOrgTree();
              self.$message({
                type: "success",
                message: "编辑企业成功"
              });
            } else {
              self.$message(data.statusMessage);
            }
          })
          .catch(msg => {
            this.$message({
              type: "info",
              message: "服务器异常"
            });
          });
      }
    },
    // 编公司删除
    bigCompantDel() {
      this.delBoxCompany = true;
      mainOverflow.style.overflowY = "hidden";
    },
    // 点击添加子公司按钮
    addChildrenCompanyClick() {
      mainOverflow.style.overflowY = "hidden";
      this.setChildrenBusiness = true;
      this.isBigcompanyName = this.isRedselectedAreaone = this.isRedselectedAreatwo = this.isRedselectedTrade = this.isRedmanagerName = this.isRedmanagerPhone = false;
      this.addCompanyTitle = "添加子公司";
      this.ParentcompanyName = this.businessName;
      this.BigcompanyName = this.managerName = this.managerPhone = "";
      this.selectedAreatwos = [{ name: "请选择", id: 0 }];
      this.selectedAreaone = this.selectedAreatwo = this.selectedTrade = 0;
    },
    // 添加子公司验证规则
    validate_1() {
      var reg_1 = /^[\s]*$/; //输入不能为空
      var reg_2 = /^[\u4e00-\u9fa5a-zA-Z]+$/; //输入中文或英文
      var reg_3 = /^1[3|4|5|6|8|9|7][0-9]\d{8}$/; //输入手机号码
      if (reg_1.test(this.BigcompanyName)) {
        this.isBigcompanyName = true;
        this.BigcompanyNameText = "请输入子公司名称";
      } else if (!reg_2.test(this.BigcompanyName)) {
        this.isBigcompanyName = true;
        this.BigcompanyNameText = "请输入中文或英文";
      } else {
        this.isBigcompanyName = false;
      }
      if (this.selectedAreaone == 0) {
        this.isRedselectedAreaone = true;
      } else {
        this.isRedselectedAreaone = false;
      }
      if (this.selectedAreatwo == 0) {
        this.isRedselectedAreatwo = true;
      } else {
        this.isRedselectedAreatwo = false;
      }
      if (this.selectedTrade == 0) {
        this.isRedselectedTrade = true;
      } else {
        this.isRedselectedTrade = false;
      }
      if (reg_1.test(this.managerName)) {
        this.isRedmanagerName = true;
        this.managerNameText = "请输入管理员姓名";
      } else if (!reg_2.test(this.managerName)) {
        this.isRedmanagerName = true;
        this.managerNameText = "请输入中文或英文";
      } else {
        this.isRedmanagerName = false;
      }
      if (reg_1.test(this.managerPhone)) {
        this.isRedmanagerPhone = true;
        this.managerPhoneText = "请输入手机号码";
      } else if (!reg_3.test(this.managerPhone)) {
        this.isRedmanagerPhone = true;
        this.managerPhoneText = "请输入正确的手机号码";
      } else {
        this.isRedmanagerPhone = false;
      }
      if (
        this.isBigcompanyName == true ||
        this.isRedselectedAreaone == true ||
        this.isRedselectedAreatwo == true ||
        this.isRedselectedTrade == true ||
        this.isRedmanagerName == true ||
        this.isRedmanagerPhone == true
      ) {
        return false;
      }
    },
    // 编辑子公司
    editChildrenCompanyClick(index) {
      mainOverflow.style.overflowY = "hidden";
      this.setChildrenBusiness = true;
      this.isBigcompanyName = this.isRedselectedAreaone = this.isRedselectedAreatwo = this.isRedselectedTrade = this.isRedmanagerName = this.isRedmanagerPhone = false;
      this.addCompanyTitle = "编辑子公司";
      this.ParentcompanyName = this.businessName;
      //获取子公司信息
      var self = this;
      var data = self.companyListSlice[index];
      self.managerName = data.managerName; //管理员名称
      self.managerPhone = data.phoneNumber; //管理员电话号
      self.childOid = data.id; //   子公司id
      self.adminId = data.managerId; //  管理员id
      self.BigcompanyName = data.name; //子公司名称
      self.selectedAreaone = data.areaId.split(",")[0]; //所在省市id
      self.selectedTrade = data.industryType; //所属行业
      var area_2 = data.areaId.split(",")[1]; //所在市区id
      self
        .getapisystemapiareagetarea({
          pid: self.selectedAreaone
        })
        .then(data => {
          if (data.statusCode == "200") {
            self.selectedAreatwo = area_2; //所在市区
            self.selectedAreatwos = data.data; //所在市区数组
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 添加子公司保存
    addChildSave() {
      var self = this;
      if (self.validate_1() == false) {
        return;
      } else {
        var areaIdArr = [];
        areaIdArr.push(self.selectedAreaone);
        areaIdArr.push(self.selectedAreatwo);
        if (self.isOnceAddChild == true) {
          self.isOnceAddChild = false;
          self
            .getcompanycreatechildrencompany(
              JSON.stringify({
                memberId: sessionStorage.getItem("memberId"),
                companyId: sessionStorage.getItem("ORGID"),
                companyName: self.BigcompanyName, //子公司名称
                areaId: areaIdArr, //所属地区id
                industryType: self.selectedTrade, //所属行业
                managerName: self.managerName,
                phoneNumber: self.managerPhone
              })
            )
            .then(data => {
              if (data.statusCode == "200") {
                self.isOnceAddChild = true;
                mainOverflow.style.overflowY = "auto";
                self.setChildrenBusiness = false;
                self.getChildCompany();
                self.$message({
                  type: "success",
                  message: "添加子公司成功"
                });
              } else {
                self.isOnceAddChild = true;
                self.$message(data.statusMessage);
              }
            })
            .catch(msg => {
              self.isOnceAddChild = true;
              this.$message({
                type: "info",
                message: "服务器异常"
              });
            });
        }
      }
    },
    // 编辑子公司保存
    editChildSave() {
      var self = this;
      if (self.validate_1() == false) {
        return;
      } else {
        var areaIdArr = [];
        areaIdArr.push(self.selectedAreaone);
        areaIdArr.push(self.selectedAreatwo);
        self
          .getcompanymodifychildrencompany(
            JSON.stringify({
              childrenCompanyId: self.childOid, //子公司编号
              managerId: self.adminId, //管理员编号
              memberId: sessionStorage.getItem("memberId"),
              companyId: sessionStorage.getItem("ORGID"),
              companyName: self.BigcompanyName, //子公司名称
              areaId: areaIdArr, //所属地区id
              industryType: self.selectedTrade, //所属行业
              managerName: self.managerName,
              phoneNumber: self.managerPhone
            })
          )
          .then(data => {
            if (data.statusCode == "200") {
              mainOverflow.style.overflowY = "auto";
              self.setChildrenBusiness = false;
              self.getChildCompany();
              self.$message({
                type: "success",
                message: "编辑子公司成功"
              });
            } else {
              self.$message(data.statusMessage);
            }
          })
          .catch(msg => {
            this.$message({
              type: "info",
              message: "服务器异常"
            });
          });
      }
    },
    // 删除子公司删除
    childCompanyDel() {
      mainOverflow.style.overflowY = "hidden";
      this.delBoxChildCompany = true;
    },
    // 确定删除子公司
    okClickChildCompany() {
      var self = this;
      mainOverflow.style.overflowY = "hidden";
      self.delBoxChildCompany = false;
      self
        .getcompanydeletechildrencompany({
          companyId: self.childOid
        })
        .then(data => {
          if (data.statusCode == "200") {
            mainOverflow.style.overflowY = "auto";
            self.delBoxChildCompany = self.setChildrenBusiness = false;
            self.getChildCompany();
            self.$message({
              type: "success",
              message: "删除子公司成功！"
            });
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          self.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    //所在地区
    selectedAreaoneClick() {
      this.getRegion(this.selectedAreaone);
    },
    selectedAreatwoClick() {},
    selectedTradeClick() {},
    // 点击添加部门按钮
    addBranchClick() {
      mainOverflow.style.overflowY = "hidden";
      var self = this;
      self.branchOpen = false;
      self.setBranch = true;
      self.branchName = "";
      self.isRedbranchName = false;
      self.seekBranchById(self.ztreeDataSource, self.selectDomId);
    },
    // 添加部门保存
    addBranchSave() {
      var self = this;
      var reg_1 = /^[\s]*$/; //输入不能为空
      var reg_2 = /^[\u4e00-\u9fa5a-zA-Z]+$/; //输入中文或英文
      if (reg_1.test(this.branchName)) {
        this.isRedbranchName = true;
        this.branchNameText = "请输入部门名称";
      } else {
        //  else if (!reg_2.test(this.branchName)) {
        //   this.isRedbranchName = true;
        //   this.branchNameText = "请输入中文或英文";
        // }
        this.isRedbranchName = false;
      }
      if (this.isRedbranchName == false) {
        if (self.batchTrue == false) {
          self.batchTrue = true;
          //添加子部门
          self
            .getbookapibookdeptcreate(
              JSON.stringify({
                memberId: sessionStorage.getItem("memberId"),
                companyId: sessionStorage.getItem("ORGID"),
                parentId: self.selectDomId,
                deptName: self.branchName,
                isCreateGroup: self.branchOpen == false ? 0 : 1
              })
            )
            .then(data => {
              self.batchTrue = false;
              if (data.statusCode == "200") {
                mainOverflow.style.overflowY = "auto";
                self.setBranch = false;
                this.getOrgTree();
                self.$message({
                  type: "success",
                  message: "添加子部门成功！"
                });
              } else if (data.statusCode == "10001") {
                self.$message("同级部门不能重名");
              } else {
                self.$message(data.statusMessage);
              }
            })
            .catch(msg => {
              this.$message({
                type: "info",
                message: "服务器异常"
              });
            });
        }
      }
    },
    // 编辑部门/获取部门信息
    editBranch() {
      this.isRedbranchdirector = false;
      this.branchdirectors = [];
      this.selectBranchTitle = "选择人员";
      // this.listFun(1);
      var self = this;
      self.isRedbranchName = false;
      //获取部门信息
      self
        .getbookapibookselectdepttree({
          deptId: self.selectDomId
        })
        .then(data => {
          if (data.statusCode == "200") {
            if (data.data.deptVo) {
              if (data.data.deptVo.managerList) {
                self.branchdirectors = [];
                data.data.deptVo.managerList.forEach(function(ele, ind) {
                  self.branchdirectors.push({
                    adminName: ele.managerName,
                    adminId: ele.managerId
                  });
                });
                self.selectMembersVal_2 = self.branchdirectors.map(function(
                  data
                ) {
                  return data.adminId;
                });
              }
            }
            if (data.data.deptShow && data.data.deptShow != "") {
              self.visibleMans = data.data.deptShow.map(function(item) {
                return {
                  type: item.type,
                  adminName: item.showName,
                  adminId: item.userDeptId
                };
              });
            } else {
              self.visibleMans = [];
            }
            self.branchName = data.data.deptVo.name;
            self.seekBranchById(
              self.ztreeDataSource,
              data.data.deptVo.parentId
            );
            self.branchOpen =
              data.data.deptVo.isAutoAddUser == 0 ? false : true; //群的状态 开启/关闭
            self.hideBranchOpen = data.data.deptVo.isHide == 0 ? false : true; //部门是否展示
            self.iscreatemsg = data.data.deptVo.isOpenGroup; //群是否创建
            self.isBranchGroup = data.data.deptVo.isOpenGroup; //群是否创建
            self.seteditBranch = true; //打开弹框
            mainOverflow.style.overflowY = "hidden";
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 编辑部门删除主管
    delbranchDirector(index) {
      this.branchdirectors.splice(index, 1);
      this.selectMembersVal_2 = this.branchdirectors.map(function(data) {
        return data.adminId;
      });
    },
    // 编辑部门删除可见人/部门
    delvisibleMan(index) {
      this.visibleMans.splice(index, 1);
      this.selectMembersVal_3 = this.visibleMans.map(function(data) {
        return { id: data.adminId, type: data.type };
      });
    },
    // 编辑部门保存
    editBranchSave() {
      var self = this;
      var reg_1 = /^[\s]*$/; //输入不能为空
      var reg_2 = /^[\u4e00-\u9fa5a-zA-Z]+$/; //输入中文或英文
      // branchNameText
      if (reg_1.test(this.branchName)) {
        this.isRedbranchName = true;
        this.branchNameText = "请输入部门名称";
      } else if (!reg_2.test(this.branchName)) {
        this.isRedbranchName = true;
        this.branchNameText = "请输入中文或英文";
      } else {
        this.isRedbranchName = false;
      }
      if (this.branchdirectors.length == 0) {
        this.isRedbranchdirector = true;
      } else {
        this.isRedbranchdirector = false;
      }
      if (this.isRedbranchName == true || this.isRedbranchdirector == true) {
        return;
      } else {
        // 判断如果是返回的数据是已经有群的话，那就是传是否解散；如果没有群的话就是时候创建；
        var submitData = {
          memberId: sessionStorage.getItem("memberId"), // 企业id
          companyId: sessionStorage.getItem("ORGID"),
          parentId: self.selectDomParentId, //父id
          deptId: self.selectDomId, //部门id
          deptName: self.branchName, //部门名称
          isCreateGroup: self.isBranchGroup == 1 ? 0 : self.iscreatemsg, //是否创建部门群
          isDisbandGroup:
            self.isBranchGroup == 0 ? 0 : self.iscreatemsg == 1 ? 0 : 1, //是否解散部门群
          isAutoAddUser: self.branchOpen == true ? 1 : 0, //是否自动加入部门群成员
          managerIds: self.selectMembersVal_2 //部门主管id
        };
        self
          .getbookapibookdeptmodify(JSON.stringify(submitData))
          .then(data => {
            if (data.statusCode == "200") {
              mainOverflow.style.overflowY = "auto";
              self.seteditBranch = false;
              self.getOrgTree();
              self.editBranchShow = true;
              self.$message({
                type: "success",
                message: "编辑部门成功"
              });
            } else {
              self.$message(data.statusMessage);
            }
          })
          .catch(msg => {
            this.$message({
              type: "info",
              message: "服务器异常"
            });
          });
      }
    },
    // 编辑部门删除
    editBranchDel() {
      mainOverflow.style.overflowY = "hidden";
      this.delBoxBranch = true;
    },
    //点击调整排序按钮
    adjustSort() {
      if (this.departmentList.length > 0) {
        this.dragLi = true;
        this.departmentListSlice = this.departmentList;
      } else {
        this.dragLi = false;
        this.$message({
          type: "info",
          message: "暂无部门，无法排序！"
        });
      }
    },
    // 点击撤销按钮
    revokeSort() {
      this.dragLi = false;
      this.getOrgTree();
    },
    // 部门排序
    sortSave() {
      var self = this;
      var arr = [];
      var sort = self.departmentList.length;
      for (var i = 0; i < self.departmentList.length; i++) {
        arr.push({
          deptId: self.departmentList[i].id,
          sort: sort--
        });
      }
      self
        .getbookapibookdeptsort(
          JSON.stringify({
            memberId: sessionStorage.getItem("memberId"),
            deptId: self.selectDomId,
            sortArray: arr
          })
        )
        .then(data => {
          if (data.statusCode == "200") {
            self.dragLi = false;
            self.getOrgTree();
            self.$message({
              type: "success",
              message: "排序操作成功"
            });
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 点击下级部门出现子部门
    childBranch(item) {
      var self = this;
      // 递归
      var recurFunc = (data, list) => {
        data.forEach(i => {
          if (i.id == item.id) {
            i.clickNode = true;
          } else {
            i.clickNode = false;
          }
          if (i.childrenList) {
            recurFunc(i.childrenList, i);
          }
        });
      };
      recurFunc(this.ztreeDataSource, this.ztreeDataSource);
      sessionStorage.setItem("mClicks", JSON.stringify(item));
      // 刷新树结构才起作用
      self.getOrgTree();
    },
    // 添加成员验证规则
    validate_2() {
      var self = this;
      var reg_1 = /^[\s]*$/; //输入为空
      var reg_2 = /^[\u4e00-\u9fa5a-zA-Z]+$/; //输入中文或英文
      var reg_3 = /^1[3|4|5|6|8|9|7][0-9]\d{8}$/; //输入手机号码
      var reg_4 = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; //邮箱正则
      var reg_5 = new RegExp(
        "[`~@#$^&*()=|{}\\[\\]<>/@#￥&*；,;（）——|{}【】]"
      ); //特殊字符
      if (reg_1.test(this.memberName)) {
        this.isRedmemberName = true;
        this.addMemberName = "请输入姓名";
      } else if (!reg_2.test(this.memberName)) {
        this.isRedmemberName = true;
        this.addMemberName = "请输入中文或英文";
      } else {
        this.isRedmemberName = false;
      }
      if (this.branchMembers.length == 0) {
        this.isRedbranchMember = true;
      } else {
        this.isRedbranchMember = false;
      }
      // 判断手机号
      // if (reg_1.test(this.memberPhone) || !reg_3.test(this.memberPhone)) {
      //     this.isRedmemberPhone = true
      // } else {
      //     this.isRedmemberPhone = false
      // }
      // 判断邮箱
      if (this.memberEmail != "" && !reg_4.test(this.memberEmail)) {
        this.isRedmemberEmail = true;
      } else {
        this.isRedmemberEmail = false;
      }
      // 判断职位
      // if (this.memberPosition != '' && reg_5.test(this.memberPosition)) {
      //     this.isRedmemberPosition = true
      // } else {
      //     this.isRedmemberPosition = false
      // }
      if (self.MobileVisibles.length > 0) {
        for (var i = 0; i < self.MobileVisibles.length; i++) {
          if (self.MobileVisibles[i].chnName == "手机号") {
            if (
              reg_1.test(self.MobileVisibles[i].value) ||
              !reg_3.test(self.MobileVisibles[i].value)
            ) {
              self.MobileVisibles[i].status = true;
              self.tips = "请输入正确的手机号码";
              self.MobileVisiblesStatus = true;
              break;
            } else {
              self.MobileVisibles[i].status = false;
              self.tips = "不能输入特殊字符";
              self.MobileVisiblesStatus = false;
            }
          } else {
            //   如果没有手机号，先把所有标红清空
            self.MobileVisibles.forEach(function(ele, ind) {
              ele.status = false;
            });
            self.MobileHides.forEach(function(ele, ind) {
              ele.status = false;
            });
            if (reg_5.test(self.MobileVisibles[i].value)) {
              self.MobileVisibles[i].status = true;
              self.tips = "不能输入特殊字符";
              self.MobileVisiblesStatus = true;
              break;
            } else {
              self.MobileVisibles[i].status = false;
              self.MobileVisiblesStatus = false; //是否通过验证的一个状态值
            }
          }
        }
      }
      if (self.MobileVisiblesStatus == false) {
        if (self.MobileHides.length > 0) {
          for (var i = 0; i < self.MobileHides.length; i++) {
            if (self.MobileHides[i].chnName == "手机号") {
              if (
                reg_1.test(self.MobileHides[i].value) ||
                !reg_3.test(self.MobileHides[i].value)
              ) {
                self.MobileHides[i].status = true;
                self.tips = "请输入正确的手机号码";
                self.MobileHidesStatus = true;
                break;
              } else {
                self.MobileHides[i].status = false;
                self.tips = "不能输入特殊字符";
                self.MobileHidesStatus = false;
              }
            } else {
              //   如果没有手机号，先把所有标红清空
              self.MobileVisibles.forEach(function(ele, ind) {
                ele.status = false;
              });
              self.MobileHides.forEach(function(ele, ind) {
                ele.status = false;
              });
              if (reg_5.test(self.MobileHides[i].value)) {
                self.MobileHides[i].status = true;
                self.tips = "不能输入特殊字符";
                self.MobileHidesStatus = true;
                break;
              } else {
                self.MobileHides[i].status = false;
                self.MobileHidesStatus = false;
              }
            }
          }
        }
      }
      if (
        this.isRedmemberName == true ||
        this.isRedbranchMember == true ||
        this.isRedmemberPhone == true ||
        this.isRedmemberEmail == true ||
        this.MobileVisiblesStatus == true ||
        this.MobileHidesStatus == true
      ) {
        return false;
      }
    },
    // 添加成员按钮
    addMemberClick() {
      this.selectBranchTitle = "选择部门";
      this.listFun(0);
      this.isRedmemberName = this.isRedbranchMember = this.isRedmemberEmail = false;
      this.setMemberTitle = "添加成员";
      this.memberName = "";
      this.memberEmail = "";
      this.branchMembers = [
        { adminName: this.selectDomName, adminId: this.selectDomId }
      ];
      this.selectMembersVal_5 = this.branchMembers.map(function(data) {
        return data.adminId;
      });
      var self = this;
      //查看企业标签
      self
        .getapiorgbookgetLabels({
          companyId: sessionStorage.getItem("ORGID")
        })
        .then(data => {
          if (data.statusCode == "200") {
            var arry = data.data;
            for (var i = 0; i < arry.length; i++) {
              if (arry[i].chnName == "姓名") {
                arry.splice(i, 1);
              }
            }
            for (var i = 0; i < arry.length; i++) {
              if (arry[i].chnName == "部门") {
                arry.splice(i, 1);
              }
            }
            for (var i = 0; i < arry.length; i++) {
              if (arry[i].chnName == "邮箱") {
                arry.splice(i, 1);
              }
            }
            var arr = [];
            var arrHide = [];
            for (var i = 0; i < arry.length; i++) {
              if (arry[i].showState == "1") {
                arr.push(arry[i]);
              } else {
                arrHide.push(arry[i]);
              }
            }
            for (var i = 0; i < arr.length; i++) {
              arr[i].status = false;
              arr[i].value = "";
            }
            self.MobileVisibles = [];
            self.MobileVisibles = arr;
            for (var i = 0; i < arrHide.length; i++) {
              arrHide[i].status = false;
              arrHide[i].value = "";
            }
            self.MobileHides = [];
            self.MobileHides = arrHide;
            self.setMember = true;
            mainOverflow.style.overflowY = "hidden";
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    //添加成员保存
    addMemberSave() {
      var self = this;
      if (self.validate_2() == false) {
        return;
      } else {
        var arr = [];
        self.MobileVisibles.forEach(function(ele, ind) {
          arr.push({
            chnName: ele.chnName,
            value: ele.value,
            showState: 1
          });
        });
        self.MobileHides.forEach(function(ele, ind) {
          arr.push({
            chnName: ele.chnName,
            value: ele.value,
            showState: 0
          });
        });
        for (var i = 0; i < arr.length; i++) {
          if (arr[i].chnName == "手机号") {
            self.memberPhone = arr[i].value;
          }
          if (arr[i].chnName == "职位") {
            self.memberPosition = arr[i].value;
          }
        }
        var addPostdata = {
          companyId: sessionStorage.getItem("ORGID"), //企业编号
          deptIds: self.selectMembersVal_5, //以‘,’分隔的部门编号集合
          name: self.memberName, //名字
          mobile: self.memberPhone, //电话号
          position: self.memberPosition, //职位
          email: self.memberEmail, //邮箱
          attrArray: arr //属性集合	jsonarray 对象集合
        };
        if (self.addTrue == false) {
          self.addTrue = true;
          self
            .getmembercreatemember(JSON.stringify(addPostdata))
            .then(data => {
              self.addTrue = false;
              if (data.statusCode == "200") {
                mainOverflow.style.overflowY = "auto";
                self.setMember = false;
                self.getOrgTree();
                self.$message({
                  type: "success",
                  message: "添加成员信息成功！"
                });
              } else if (data.statusCode == "10002") {
                self.$message("该成员已经加入企业，请选择更新成员信息");
              } else {
                self.$message(data.statusMessage);
              }
            })
            .catch(msg => {
              self.addTrue = false;
              self.$message({
                type: "info",
                message: "服务器异常"
              });
            });
        }
      }
    },
    //  编辑成员
    editMember(index, item) {
      this.listFun(0);
      this.isRedmemberName = this.isRedbranchMember = this.isRedmemberEmail = false;
      this.setMemberTitle = "编辑成员";
      this.selectUserId = item.memberId;
      this.getMemberInfo(item.memberId);
    },
    getMemberInfo(memberId) {
      var self = this;
      //查看企业标签
      self
        .getapiorgbookgetLabels({
          companyId: sessionStorage.getItem("ORGID")
        })
        .then(data => {
          if (data.statusCode == "200") {
            var arry = data.data;
            // 获取成员详情/*****************************
            self
              .getmembermemberdetail({
                memberId: memberId
              })
              .then(data => {
                if (data.statusCode == "200") {
                  if (data.data) {
                    self.activityStatusTrue = data.data.activityStatus;
                    /*****取消掉姓名、部门、邮箱*******/
                    for (var i = 0; i < arry.length; i++) {
                      if (arry[i].chnName == "姓名") {
                        arry.splice(i, 1);
                      }
                    }
                    for (var i = 0; i < arry.length; i++) {
                      if (arry[i].chnName == "部门") {
                        arry.splice(i, 1);
                      }
                    }
                    for (var i = 0; i < arry.length; i++) {
                      if (arry[i].chnName == "邮箱") {
                        arry.splice(i, 1);
                      }
                    }
                    if (data.data.memberName) {
                      self.memberName = data.data.memberName; //姓名
                    } else {
                      self.memberName = "";
                    }
                    if (data.data.deptIds && data.data.deptNames) {
                      //部门
                      self.branchMembers = [];
                      var arr = [];
                      data.data.deptIds.forEach(function(ele, ind) {
                        arr.push({
                          adminName: ind,
                          adminId: ele
                        });
                      });
                      data.data.deptNames.forEach(function(ele, ind) {
                        arr.forEach(function(elea, index) {
                          if (arr[index].adminName == ind) {
                            arr[index].adminName = ele;
                          }
                        });
                      });
                      self.branchMembers = arr; //部门
                    } else {
                      self.branchMembers = [];
                    }
                    if (data.data.email) {
                      self.memberEmail = data.data.email; //邮箱
                    } else {
                      self.memberEmail = "";
                    }
                    /***************/
                    /***************/
                    var arr = [];
                    var arrHide = [];
                    for (var i = 0; i < arry.length; i++) {
                      for (var j = 0; j < data.data.memberExtend.length; j++) {
                        if (
                          arry[i].chnName == data.data.memberExtend[j].chnName
                        ) {
                          arry[i].value = data.data.memberExtend[j].value;
                        }
                        if (arry[i].chnName == "手机号") {
                          arry[i].isPhoneLive = true;
                        }
                      }
                      arry[i].status = false;
                    }
                    for (var i = 0; i < arry.length; i++) {
                      if (arry[i].showState == "1") {
                        arr.push(arry[i]);
                      } else {
                        arrHide.push(arry[i]);
                      }
                    }
                    self.MobileVisibles = [];
                    self.MobileVisibles = arr;
                    self.MobileHides = [];
                    self.MobileHides = arrHide;
                    console.log(self.MobileHides);
                    self.selectMembersVal_5 = data.data.deptIds;
                  }
                  self.setMember = true; //编辑成员弹出框
                  mainOverflow.style.overflowY = "hidden";
                } else {
                  self.$message(data.statusMessage);
                }
              })
              .catch(msg => {
                this.$message({
                  type: "info",
                  message: "服务器异常"
                });
              });
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    //编辑成员保存
    amendMemberSave() {
      var self = this;
      if (self.validate_2() == false) {
        return;
      } else {
        var arr = [];
        self.MobileVisibles.forEach(function(ele, ind) {
          arr.push({
            chnName: ele.chnName,
            value: ele.value,
            showState: 1
          });
        });
        self.MobileHides.forEach(function(ele, ind) {
          arr.push({
            chnName: ele.chnName,
            value: ele.value,
            showState: 0
          });
        });
        for (var i = 0; i < arr.length; i++) {
          if (arr[i].chnName == "手机号") {
            self.memberPhone = arr[i].value;
          }
          if (arr[i].chnName == "职位") {
            self.memberPosition = arr[i].value;
          }
        }
        var addPostdata = {
          memberId: self.selectUserId, //成员id
          companyId: sessionStorage.getItem("ORGID"), //企业编号
          deptIds: self.selectMembersVal_5, //以‘,’分隔的部门编号集合
          name: self.memberName, //名字
          mobile: self.memberPhone, //电话号
          position: self.memberPosition, //职位
          email: self.memberEmail, //邮箱
          attrArray: arr //属性集合	jsonarray 对象集合
        };

        if (self.addTrue == false) {
          self.addTrue = true;
          self
            .getmembermodifymember(JSON.stringify(addPostdata))
            .then(data => {
              self.addTrue = false;
              if (data.statusCode == "200") {
                self.setMember = false;
                mainOverflow.style.overflowY = "auto";
                self.getOrgTree();
                self.$message({
                  type: "success",
                  message: "编辑成员信息成功！"
                });
              } else {
                self.$message(data.statusMessage);
              }
            })
            .catch(msg => {
              self.addTrue = false;
              self.$message({
                type: "info",
                message: "服务器异常"
              });
            });
        }
      }
    },
    // 编辑成员删除
    delMember() {
      mainOverflow.style.overflowY = "hidden";
      this.delBoxMember = true;
    },
    // 点击自定义手机端展示
    custom() {
      this.$router.push({
        path: "/home/install/communication"
      });
      mainOverflow.style.overflowY = "auto";
    },
    // 添加成员删除部门
    delbranchMember(index) {
      this.branchMembers.splice(index, 1);
      this.selectMembersVal_5 = this.branchMembers.map(function(data) {
        return data.adminId;
      });
    },
    hoverLi(index) {
      this.isactiveLi = index;
    },
    noHoverLi(index) {
      this.isactiveLi = 1111111;
    },
    // 点击成员排序保存
    sortSaveMember() {
      var self = this;
      var arr = [];
      self.dataLists.forEach(function(ele, ind) {
        arr.push(ele.memberId);
      });
      self
        .getmembermembersort(
          JSON.stringify({
            // memberId: sessionStorage.getItem('memberId'),
            deptId: self.selectDomId,
            memberIds: arr.join(",")
          })
        )
        .then(data => {
          if (data.statusCode == "200") {
            self.dragLiMember = false;
            self.getBranchMember();
            self.checked = false;
            self.$message({
              type: "success",
              message: "排序操作成功"
            });
          } else {
            self.$message(data.statusMessage);
            self.checked = false;
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 点击成员排序撤销
    revokeSortMember() {
      this.checkList = [];
      this.checked = false;
      this.dragLiMember = false;
      this.getBranchMember();
    },
    // 点击部门人员下的调整排序按钮
    adjustSortMember() {
      if (this.dataLists.length == 0) {
        this.$message("没有人员暂时无法排序");
        this.dragLiMember = false;
      } else {
        this.checkList = [];
        this.dragLiMember = true;
      }
    },
    // 点击批量删除按钮
    batchDel() {
      if (this.dataLists.length == 0) {
        this.$message("没有人员暂时无法删除！");
        return;
      } else {
        if (this.checkList.length == 0) {
          this.$message("请选择部门人员！");
        } else {
          mainOverflow.style.overflowY = "hidden";
          this.delBoxMemberBatch = true;
        }
      }
    },
    // 点击批量删除确定按钮
    okClickMemberBatch() {
      var self = this;
      mainOverflow.style.overflowY = "auto";
      self.delBoxMemberBatch = false;
      self
        .getmemberbatchdeletemember({
          companyId: sessionStorage.getItem("ORGID"),
          memberIds: self.memberIdArr,
          deptId: self.selectDomId
        })
        .then(data => {
          if (data.statusCode == "200") {
            self.getBranchMember();
            self.delBoxMemberBatch = false;
            self.getOrgTree();
            self.$message({
              type: "success",
              message: "删除成功"
            });
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    // 点击批量导入/导出按钮
    batchImport() {
      this.$router.push({
        path: "/excelUpload"
      });
    },
    // 团队邀请
    team() {
      this.$router.push({
        path: "/team"
      });
    },
    // 公司是否开启自动添加成员
    companyOpenClick() {
      this.companyOpen = !this.companyOpen;
    },
    // 部门是否开启自动添加成员
    branchOpenClick() {
      this.branchOpen = !this.branchOpen;
    },
    // 部门是否隐藏当前部门
    hideBranchOpenClick() {
      this.hideBranchOpen = !this.hideBranchOpen;
    },
    //搜索出来的成员hover
    selectHover(index) {
      this.now = index;
    },
    // 点击搜索出来的成员
    searchLiClick(index) {
      this.now = index;
      this.listFun(0);
      this.isRedmemberName = this.isRedbranchMember = this.isRedmemberEmail = false;
      if (this.searchDatas.length > 0) {
        this.keyword = this.searchDatas[this.now].memberName;
        this.keywordId = this.searchDatas[this.now].memberId;
        this.selectUserId = this.searchDatas[this.now].memberId;
        this.setMember = true;
      }
      this.isSearchList = false;
      this.isnoSearchList = false;
      this.now = -1;
      this.setMemberTitle = "编辑成员";
      this.getMemberInfo(this.keywordId);
    },
    // 全局搜索成员 发请求
    getRequest() {
      var self = this;
      if (self.keyword == "") {
        return;
      }
      self
        .getmembermemberquery({
          companyId: sessionStorage.getItem("ORGID"),
          deptId: "",
          queryName: self.keyword
        })
        .then(data => {
          if (data.statusCode == "200") {
            if (data.data) {
              if (data.data.length > 0) {
                self.searchDatas = data.data;
                self.isSearchList = true;
                self.isnoSearchList = false;
              } else {
                self.searchDatas = [];
                self.isSearchList = false;
                self.isnoSearchList = true;
              }
            } else {
              self.searchDatas = [];
              self.isnoSearchList = true;
              self.isSearchList = false;
            }
          } else {
            self.$message(data.statusMessage);
          }
        })
        .catch(msg => {
          this.$message({
            type: "info",
            message: "服务器异常"
          });
        });
    },
    //全局搜索成员 键盘事件
    getRequestKey(e) {
      if (this.isSearchList == true) {
        var self = this;
        // 如果按键是上或者下，就不进行ajax
        if (event.keyCode == 38) {
          self.selectUp();
          return;
        }
        if (event.keyCode == 40) {
          self.selectDown();
          return;
        }
        if (event.keyCode == 13) {
          self.isSearchList = self.isnoSearchList = false;
          return;
        }
        if (this.keyword == "") {
          self.isSearchList = self.isnoSearchList = false;
          self.searchDatas = [];
          return;
        }
      }
    },
    selectDown() {
      var searchListId = document.getElementById("searchListId");
      if (this.searchDatas.length > 0) {
        this.now++;
        if (this.now >= this.searchDatas.length) {
          this.now = 0;
          searchListId.scrollTop = 0;
        }
        if (this.now > 6) {
          searchListId.scrollTop = searchListId.scrollTop + 61;
        }
        this.keyword = this.searchDatas[this.now].memberName;
      } else {
        return;
      }
    },
    selectUp: function() {
      var searchListId = document.getElementById("searchListId");
      if (this.searchDatas.length > 0) {
        this.now--;
        //同上
        if (this.now < 0) {
          this.now = this.searchDatas.length - 1;
          searchListId.scrollTop = this.searchDatas.length * 61;
        } else {
          searchListId.scrollTop = searchListId.scrollTop - 61;
        }
        this.keyword = this.searchDatas[this.now].memberName;
      } else {
        return;
      }
    },

    // 解散部门群聊
    dissolutionGroupClick() {
      this.iscreatemsg = 0;
      this.branchOpen = false;
    },
    // 创建部门群聊
    createGroupClick() {
      this.iscreatemsg = 1;
      this.branchOpen = true;
    },
    // 解散企业群聊
    dissolutionGroupCompany() {
      this.iscreatemsgCompany = 0;
      this.companyOpen = false;
    },
    // 创建企业群聊
    createGroupCompany() {
      this.iscreatemsgCompany = 1;
      this.companyOpen = true;
    },
    // 清空input内容
    emptyKeyword() {
      this.keyword = "";
      this.isSearchList = this.isnoSearchList = false;
    },
    clearSearchClick() {
      this.searchsmemVal = "";
    },
    ...mapActions([
      "getmembermemberquery",
      "getbookapibookdeptmodify",
      "getbookapibookdeptcreate",
      "getbookapibookselectbooktree",
      "getbookapibookchildrendeptdelete",
      "getbookapibookselectdepttree",
      "getcompanymodifycompany",
      "getbookapibookcompanylist",
      "getcompanycreatechildrencompany",
      "getbookapibookuserlist",
      "getapisystemapiareagetarea",
      "getbookapibookselectcompanytree",
      "getcompanymodifychildrencompany",
      "getapiorgbookgetLabels",
      "getmembercreatemember",
      "getmembermemberdetail",
      "getmembermodifymember",
      "getmemberbatchdeletemember",
      "getbookapibookdeptsort",
      "getmembermembersort",
      "getcompanydeletechildrencompany",
      "getmemberuseradjustdept",
      "getbookapibookdeptlist"
    ])
  }
};
</script>
<!--私有样式-->
<style scoped>
.pantidname {
  margin-left: 30px;
  color: #000;
  font-size: 16px;
  margin-right: 60px;
  width: 200px;
  height: 30px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

#parentOrgName a {
  color: #000 !important;
  cursor: auto !important;
}

#noDelTip {
  margin: 15px;
  text-align: center;
  background: #fcf8e3;
  color: #8a6d3b;
}

#noDelTip {
  margin: 15px;
  text-align: center;
  background: #fcf8e3;
  color: #8a6d3b;
}

.graybutStyle {
  background: lightgray;
  cursor: default !important;
}

.addrest {
  height: 100%;
  position: relative;
}

.mr_10 {
  margin-right: 10px;
}

.sortTipMember {
  margin-left: 18px;
  margin-top: 10px;
  width: 95%;
}

.dataLi {
  cursor: pointer;
}

.activeLi {
  background: #ebebeb;
}

.searchIcon {
  background: url("/static/img/Slice.png") no-repeat 5% 67%;
  width: 24px;
  height: 20px;
  cursor: pointer;
}

.noChildren {
  text-align: center;
  margin: 20px;
  font-size: 12px;
  color: #929292;
}

.selectback {
  background: #f7f2f1;
}

/*删除提示框*/

.delBox {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.15);
  z-index: 1000000;
}

.delContent {
  width: 340px;
  height: 180px;
  background-color: #fff;
  border: solid 1px #ffd0bf;
  box-shadow: 0 2px 4px 0 #dbdbdb;
  border-radius: 4px;
  margin: calc((100vh - 280px) / 2) auto;
  z-index: 100000;
}

.delStyle {
  border: solid 1px #38adff !important;
  color: #38adff;
}

.mf_89 {
  margin-left: 89px;
}

.redInput {
  border: 1px solid #38adff !important;
}

.redFont {
  font-size: 12px;
  margin-top: 5px;
  color: #38adff !important;
}

input {
  padding-left: 10px;
  width: 230px;
  height: 32px;
  border-radius: 3px;
  border: solid 1px #d7d7d7;
}

select {
  margin-left: 5px;
  height: 32px;
  line-height: 32px;
  padding-left: 7px;
  color: #8f8e94;
  border-radius: 3px;
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  background: url("/static/img/hjian.png") 90% 8px no-repeat transparent;
  padding-left: 14px;
  font-size: 14px;
  color: #97969b;
  border: 1px solid #d1d1d1;
  text-align: center;
  overflow: hidden;
}

select::-ms-expand {
  display: none;
}

/* .breadcrumbs>li+li:before {
        color: #cccccc;
        content: ">";
        padding: 0 5px;
    } */

.breadcrumbs li {
  cursor: pointer;
  color: #38adff;
}

.breadcrumbs li a {
  text-decoration: none;
  color: #38adff;
}

.breadcrumbs li:nth-last-child(1) {
  cursor: default;
  color: #000;
}

.sadeNav {
  color: #fff !important;
  background: #38adff !important;
}

.main_left {
  float: left;
  width: 259px;
  height: 100%;
  background: #409eff0d;
  overflow-y: hidden;
  overflow-x: auto;
  border-right: 1px solid #ccc;
}

.main_left li {
  cursor: pointer;
  line-height: 40px;
  color: #000;
  font-size: 14px;
}

.ztree li:hover {
  background: #f7f2f1;
}

.main_left li div span {
  margin-left: 15px;
}

.main_left > div:nth-child(4) {
  padding: 0 13px;
}

.main_right {
  width: calc(100% - 261px);
  height: 100%;
  float: left;
  overflow-y: hidden;
  overflow-x: hidden;
  border-left: 1px solid #ccc;
}

.main_right > div:nth-child(1) {
  padding: 32px 0px 0 24px;
  width: 888px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.main_right > div:nth-child(2) {
  margin: 0 24px;
}

.main_right > div:nth-child(2) li {
  align-items: center;
  display: flex;
  height: 52px;
  line-height: 52px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.main_right > div:nth-child(2) .branchData li > div,
.checkCl div:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 175px;
}

.searchInput {
  display: flex;
  align-items: center;
  width: 220px;
  height: 36px;
  border-radius: 4px;
  background-color: #ffffff;
  border: solid 1px #dfdfdf;
  margin: 25px 20px;
}

.searchInput > div:nth-child(2) input {
  height: 34px;
  line-height: 34px;
  width: 100%;
  padding-left: 0;
  border: none;
}

.navTitle {
  display: flex;
  justify-content: space-between;
  align-content: center;
}

.navTitle > div:nth-child(1) {
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.5px;
  color: #303030;
}

.navTitle > div:nth-child(1) small {
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 2px;
  background-color: #7cb8f1;
  font-size: 12px;
  line-height: 1.17;
  color: #ffffff;
}

.navTitle > div:nth-child(2) {
  text-align: center;
  width: 60px;
  height: 24px;
  line-height: 24px;
  border-radius: 2px;
  border: solid 1px #636267;
  cursor: pointer;
}

.nav ol {
  margin-top: 21px;
  margin-bottom: 30px;
  padding-left: 5px;
  overflow: hidden;
}

.nav ol li {
  float: left;
}

.smallCompany {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-bottom: 26px;
  border-bottom: solid 1px rgba(0, 0, 0, 0.1);
}

.smallCompany > div {
  display: flex;
  justify-content: center;
}

.font_18 {
  font-size: 18px;
  font-weight: 500;
}

.butStyle {
  width: 80px;
  height: 24px;
  line-height: 24px;
  border-radius: 2px;
  border: solid 1px #636267;
  text-align: center;
  cursor: pointer;
}

.childrenCompanyUl {
  margin: 0 18px;
  width: 860px;
}

.childrenCompanyUl li div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.childrenCompanyUl li div:nth-child(1) {
  margin-left: 50px;
  width: 140px;
}

.childrenCompanyUl li div:nth-child(2) {
  margin-left: 150px;
  width: 70px;
}

.childrenCompanyUl li div:nth-child(3) {
  margin-left: 63px;
  width: 110px;
}

.childrenCompanyUl li div:nth-child(4) {
  margin-left: 152px;
  cursor: pointer;
}

.lookAll {
  color: #38adff;
  margin-top: 15px;
  cursor: pointer;
}

.subDepartments {
  margin: 0 18px;
  width: 860px;
}

.subDepartments li {
  justify-content: space-between;
  cursor: pointer;
}

.subDepartments li:hover {
  background: #ebebeb;
}

.angleIcon {
  border-bottom: 1px solid #6b5e5e;
  width: 9px;
  border-right: 1px solid #6b5e5e;
  height: 9px;
  transform: rotate(-45deg);
  margin-right: 15px;
}

.subDepartments li > div:nth-child(1) {
  display: flex;
  align-items: center;
}

.butBox {
  margin-left: 18px;
  display: flex;
}

.butBox > div {
  margin-right: 15px;
}

.butBox > div:nth-child(2) {
  width: 100px;
}

.checkBoxCl,
.checkCl {
  display: flex;
  margin-left: 20px;
  width: 25px !important;
}

.checkBoxCl label,
.checkCl label {
  margin-bottom: 0px !important;
}

.branchData {
  margin: 0 18px;
  width: 860px;
  margin-top: 20px;
}

.firstLi {
  height: 44px !important;
  line-height: 44px !important;
  background-color: #38acff2f;
}

/*.branch li>div:nth-child(1) {
        width: 125px;
    }
    .branch li>div:nth-child(2) {
        width: 180px;
    }
    .branch li>div:nth-child(3) {
        width: 210px;
    }
    .branch li>div:nth-child(4) {
        width: 200px;
    }*/

.companyInfo,
.companyGroup {
  padding: 0 15px;
  display: flex;
  justify-content: space-between;
  background: #38acff13;
  height: 40px;
  line-height: 40px;
}

.companyGroup {
  margin-top: 30px;
}

.companyInfoDetail {
  padding-left: 15px;
}

.ChildcompanyInfoDetail > div:nth-child(1),
.ChildcompanyInfoDetail > div:nth-child(2) {
  /*margin: 20px 0px 20px 0px;*/
  height: 32px;
  line-height: 32px;
}

.companyInfoDetail p {
  margin-left: 85px;
  margin-top: 5px;
}

.companyInfoDetail > div,
.branchInfoDetail > div {
  /*margin: 20px 0px 20px 13px;*/
  height: 32px;
  line-height: 32px;
  margin-top: 20px;
}

.branchInfoDetail > div {
  margin-left: 13px;
}

.companyInfoDetail > div:nth-child(2) {
  margin-left: 13px;
}

.directorSelect {
  margin-left: 13px;
  display: flex;
  margin-top: 20px;
  height: 32px;
  line-height: 32px;
}

.directorSelect > div {
  width: 230px;
  height: 32px;
  border-radius: 3px;
  border: solid 1px #d7d7d7;
  padding-left: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-left: 5px;
}

.directorSelect > div ul {
  height: 100%;
}

.directorSelect > div ul li {
  float: left;
  margin-top: 4px;
  position: relative;
  margin-right: 10px;
}

.directorSelect > div ul li div:nth-child(1) {
  font-size: 12px;
  /*width: 34px;*/
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 3px;
  background-color: #38acff4f;
  padding: 0 5px;
}

.directorSelect > div ul li div:nth-child(2) {
  position: absolute;
  top: -3px;
}

.xicon {
  cursor: pointer;
  float: left;
  width: 12px;
  height: 12px;
  background: url(/static/img/Group.png) no-repeat;
  background-size: 100%;
  right: -8px;
}

/* .xiconBor{
        position: absolute;
        width: 20px;
        height: 20px;
        border-radius: 100%;
    }

    .xiconX{    

    } */

.companyInfoDetail input {
  background-color: #ededed;
}

.created {
  border-radius: 2px;
  border: solid 1px #7eb1e0;
  font-size: 10px;
  color: #7eb1df;
  margin-left: 5px;
}

.dissolutionGroup {
  cursor: pointer;
  font-size: 14px;
  color: #38adff;
}

.companyGroupDetail {
  display: flex;
  padding-left: 28px;
  margin: 25px 0px 10px 0px;
  width: 90%;
  justify-content: space-between;
}

.companyGroupDetail > div:nth-child(2) {
  cursor: pointer;
}

.newcomer {
  padding-left: 28px;
  font-size: 12px;
  color: #a6a2a2;
}

.newcomer a {
  margin-left: 10px;
  cursor: pointer;
  color: #38adff;
}

.modalLeftfootCompany input:nth-child(2) {
  color: #fff;
  margin-right: 16px;
  background-color: #38adff;
}

.modalLeftfootCompany input:nth-child(1) {
  color: #fff;
  margin-right: 16px;
  background-color: #38adff;
}

.modalLeftfootCompany input:nth-child(3) {
  margin-right: 16px;
  border: solid 1px #c4bebe;
}

.modalLeftfootChildCompany input:nth-child(1) {
  color: #fff;
  margin-right: 16px;
  background-color: #38adff;
}

.modalLeftfootChildCompany input:nth-child(2) {
  color: #fff;
  margin-right: 16px;
  background-color: #38adff;
}

.modalLeftfootChildCompany input:nth-child(3) {
  margin-right: 16px;
  background-color: buttonface;
  border: solid 1px #c4bebe;
}

.modalLeftfootChildCompany input:nth-child(4) {
  margin-right: 16px;
  border: solid 1px #c4bebe;
}

.modalLeftfootsBranch input:nth-child(1) {
  color: #fff;
  margin-right: 16px;
  background-color: #38adff;
}

.modalLeftfootsBranch input:nth-child(2) {
  color: #fff;
  margin-right: 16px;
  background-color: #c4bebe;
}

.modalLeftfootBranch input:nth-child(2) {
  color: #fff;
  margin-right: 16px;
  background-color: #38adff;
}

.modalLeftfootBranch input:nth-child(3) {
  margin-right: 16px;
  background-color: buttonface;
  border: solid 1px #c4bebe;
}

.modalLeftfootBranch input:nth-child(4) {
  margin-right: 16px;
  border: solid 1px #c4bebe;
}

.ChildcompanyInfoDetail > div {
  height: 32px;
  line-height: 32px;
  margin-top: 20px;
}

.ChildcompanyInfoDetail > div:nth-child(3) {
  padding-left: 14px;
  display: flex;
}

.ChildcompanyInfoDetail > div:nth-child(4),
.ChildcompanyInfoDetail > div:nth-child(5) {
  padding-left: 14px;
  display: flex;
}

.managerDetail > div {
  height: 32px;
  line-height: 32px;
  margin-top: 20px;
}

.managerDetail > div:nth-child(3) {
  margin-left: 14px;
}

.managerDetail > div:nth-child(5) {
  width: 366px;
  height: 130px;
  border: 1px dotted #ece1df;
  padding: 19px 20px;
  color: #7e7979;
  font-size: 12px;
  line-height: 20px;
}

.managerDetail > div:nth-child(5) h2 {
  font-size: 14px;
  margin: 0;
}

.sortTip {
  height: 36px;
  line-height: 36px;
  background-color: #e0f0ff;
  text-align: center;
}

.sortTip span:nth-child(2) {
  margin: 0 10px 0 30px;
}

.sortTip span:nth-child(2),
.sortTip span:nth-child(3) {
  color: #38adff;
  cursor: pointer;
}

/*添加成员样式*/

.MobileDetail p {
  margin-left: 86px;
}

.MobileDetail > div,
.hideLable {
  height: 32px;
  line-height: 32px;
  margin-top: 20px;
  margin-left: 13px;
}

.MobileDetail > div input,
.hideLable input {
  background: #fff;
}

.MobileDetail > div > span,
.hideLable > span {
  float: left;
  width: 85px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hideLable {
  height: auto !important;
}

.hideLable > p {
  height: 10px;
  line-height: 10px;
  margin-left: 105px;
}

.modalLeftfootMember input {
  margin-right: 16px;
}

.modalLeftfootMember input:nth-child(1),
.modalLeftfootMember input:nth-child(2) {
  color: #fff;
  background-color: #38adff;
}

.modalLeftfootMember input:nth-child(3) {
  background-color: buttonface;
  border: solid 1px #c4bebe;
}

.modalLeftfootMember input:nth-child(4) {
  background-color: buttonface;
  border: solid 1px #c4bebe;
}

.modalLeftfootMember input:nth-child(5) {
  margin-right: 16px;
  border: solid 1px #c4bebe;
}

.searchList {
  position: absolute;
  background: #fff;
  z-index: 100;
  top: 61px;
  left: 21px;
  width: 350px;
  border: solid 1px #ececec;
}

.searchList > ul {
  height: 435px;
  overflow-y: auto;
}

.searchList > ul > li {
  display: flex;
  align-items: center;
  height: 60px;
  line-height: 60px;
  border-bottom: solid 1px #e2e2e2;
  padding-left: 15px;
}

.searchList > ul > li > div:nth-child(1) {
  width: 40px;
  height: 38px;
}

.searchList > ul > li > div > img {
  width: 100%;
  height: 100%;
  vertical-align: baseline;
  border-radius: 100%;
}

.imgNo {
  width: 40px;
  height: 38px;
  border-radius: 100%;
  background: #38adff;
  line-height: 38px;
  text-align: center;
  color: white;
}

.searchList > ul > li > div {
  width: 56px;
  text-align: left;
  margin: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchList > ul > li > div:nth-of-type(4) {
  width: 102px;
  margin: 0;
}

.nosearchList {
  height: 205px;
}

.nosearchList p {
  text-align: center;
  margin-top: 20px;
  color: #aaa;
}

#noAuthority {
  text-align: center;
  border-bottom: none;
  margin-top: 200px;
}

#treeBox {
  width: 244px;
}

#adjustbutStyle {
  margin-right: 15px;
}

.subDepartments-name {
  margin: 0 5px;
}

#smallCompanyBorder {
  border-bottom: none;
}

#directorSelect-right {
  margin-left: 4px;
}

#directorSelect-rights {
  margin-left: 4px;
}

#nogroup {
  margin: 20px;
}

#nogroupBranch {
  margin: 20px;
}

.ml89 {
  margin-left: 89px;
}

#areaSelectTwo {
  margin-left: 20px;
}

.selectWidth {
  width: 100px;
}

#higherBranchBox {
  margin-left: 13px;
}

#branchNameInput {
  background: #fff;
}

#branchNameInputEdit {
  background: #fff;
}

.mustIcon {
  color: #38adff !important;
  margin-right: 5px;
}

.activityMember {
  color: #38adff;
  font-size: 12px;
  margin-top: 5px;
}

/***********************************弹出组件***************************/

/*成员弹出*/

.centerCenter > div {
  width: 30px;
  height: 30px;
  background-color: #fff;
  color: #000;
  margin-top: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}

.centerCenter > div > img {
  width: 30px;
  height: 30px;
}

.centerCenter {
  width: 50px;
  height: 100%;
  margin-left: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.centerRightBotLiR {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 15px;
}

.centerRightBotLiL > div:nth-child(1) img {
  width: 100%;
  height: 100%;
}

.centerRightBotLiL > div:nth-child(1) {
  width: 17px;
  height: 17px;
  border-radius: 3px;
  border: 1px solid #ececec;
  margin-right: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.centerRightBotLiL > div:nth-child(2) img {
  width: 100%;
  height: 100%;
}

.centerRightBotLiL > div:nth-child(2) {
  width: 17px;
  height: 17px;
  border-radius: 3px;
  border: 1px solid #ececec;
  margin-right: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.centerRightBotLiL > div:nth-child(3) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 250px;
}

.centerRightBotLiL {
  display: flex;
  align-items: center;
  justify-content: center;
}

.centerRightBot {
  height: 235px;
  margin-top: 5px;
  overflow-x: hidden;
  overflow-y: scroll;
}

.centerRightBot ul li:hover {
  background-color: #f6f6f6;
}

.centerRightBot ul li:nth-child(1) {
  margin-top: 20px;
}

.centerRightBot ul li {
  display: flex;
  align-items: center;
  height: 27px;
  width: 100%;
  cursor: pointer;
  padding-left: 15px;
  justify-content: space-between;
}

.centerRightBot {
  height: 365px;
  border-radius: 5px;
  background-color: #fff;
  border: 1px solid #fff;
}

.centerLeftBotFourLiR {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 15px;
  color: #38adff;
}

.centerLeftBotFourLiL > div:nth-child(3) {
  width: 17px;
  height: 17px;
  margin-right: 7px;
  margin-top: -6px;
}

.centerLeftBotFourLiL > div:nth-child(3) img {
  width: 100%;
  height: 100%;
}

.centerLeftBotFourLiL > div:nth-child(4) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 250px;
}

.centerLeftBotFourLiL > div:nth-child(1) > img:nth-child(1),
.centerLeftBotFourLiL > div:nth-child(2) > img:nth-child(1) {
  width: 16px;
  height: 16px;
}

.centerLeftBotFourLiL > div:nth-child(1) > img:nth-child(2),
.centerLeftBotFourLiL > div:nth-child(2) > img:nth-child(2) {
  width: 17px;
  height: 17px;
}

.centerLeftBotFourLiL > div:nth-child(1),
.centerLeftBotFourLiL > div:nth-child(2) {
  width: 17px;
  height: 17px;
  border-radius: 3px;
  border: 1px solid #ececec;
  margin-right: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.centerLeftBotFourLiL {
  display: flex;
  align-items: center;
  justify-content: center;
}

.centerLeftBotFour {
  height: 235px;
  margin-top: 5px;
  overflow-x: hidden;
  overflow-y: scroll;
}

.centerLeftBotFour ul li:hover {
  background-color: #f6f6f6;
}

.centerLeftBotFour ul li {
  display: flex;
  align-items: center;
  height: 27px;
  width: 100%;
  cursor: pointer;
  padding-left: 15px;
  justify-content: space-between;
}

.centerLeftBotThr {
  height: 25px;
  margin-top: 5px;
  display: flex;
  align-items: center;
}

.centerLeftBotThr > div:nth-child(1) {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 15px;
  margin-top: 5px;
}

.centerLeftBotThr > div:nth-child(2) {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

.centerLeftBotOne {
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.centerLeftBotOneL {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.centerLeftBotOneI input {
  height: 30px;
  border: none;
  line-height: 30px;
  vertical-align: baseline;
}

.centerLeftBotOneI {
  width: 310px;
  height: 30px;
  line-height: 30px;
  font-size: 15px;
  color: #000;
}

.centerLeftBotOne > div {
  width: 370px;
  height: 32px;
  border-radius: 3px;
  border: 1px solid #d1c4b9;
  display: flex;
  align-items: center;
}

.centerLeftBotTwoFontblue {
  color: #38adff;
  margin-right: 5px;
  margin-left: 5px;
  cursor: pointer;
}

.centerLeftBotTwo ul li:nth-child(1) > div:nth-child(2) {
  margin-left: 0px;
}

.centerLeftBotTwo ul {
  margin-left: 15px;
}

.centerLeftBotTwo ul li {
  float: left;
  display: flex;
}

.centerLeftBotTwo {
  min-height: 20px;
}

.centerLeftBot > div {
  width: 100%;
}

.centerLeftBot {
  height: 365px;
  border-radius: 5px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #fff;
}

.centerLeftTop,
.centerRightTop {
  height: 45px;
  background-color: #f4f4f5;
  line-height: 55px;
  font-size: 16px;
  color: #000;
  padding-left: 5px;
}

.centerLeft {
  width: 400px;
  height: 410px;
  margin-left: 30px;
}

.centerRight {
  width: 400px;
  height: 410px;
  margin-left: 20px;
}

.ModalsmemTop {
  width: 100%;
  height: 66px;
  background-color: #fff;
  text-align: center;
  font-size: 16px;
  color: #303030;
  line-height: 66px;
}

.ModalsmemCenter {
  width: 100%;
  height: 410px;
  background-color: #f4f4f5;
  display: flex;
}

.ModalsmemBot {
  width: 100%;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f4f4f5;
}

.ModalsmemBot .el-button:nth-child(1) {
  margin-right: 22px;
}
.ModalsmemBot .el-button:nth-child(2) {
  margin-left: 22px;
}

.Modalsmem {
  width: 960px;
  height: 560px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.5);
  animation: madalsBox 0.8s;
  background-color: #fff;
  display: flex;
  flex-wrap: wrap;
  border-radius: 4px;
}

@keyframes madalsBox {
  from {
    transform: translateY(-200px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ModalsmemBox {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  z-index: 9999;
}

/*成员弹出*/

.set {
  position: relative;
}

.addChildTop {
  width: calc(100%-88px);
  height: auto;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-left: 44px;
  margin-right: 44px;
  padding-top: 20px;
  padding-bottom: 12px;
  color: #303030;
  font-size: 14px;
}

.addChildTop img {
  margin-right: 8px;
}

.addChildBot {
  width: calc(100%-88px);
  height: auto;
  margin-left: 44px;
  margin-right: 44px;
  margin-top: 20px;
}

.member {
  width: 100%;
  height: auto;
  padding-left: 54px;
}

.member input {
  width: 320px;
  height: 30px;
  margin-left: 12px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding-left: 5px;
}

.chainCommand {
  width: 100%;
  height: auto;
  margin-left: 27px;
  margin-top: 20px;
}

.branch {
  margin-left: 90px;
  margin-top: -20px;
}

.branch label {
  margin-left: 10px;
}

#Specific {
  width: 320px;
  height: 30px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding-left: 5px;
}

.privileges {
  width: 100%;
  height: auto;
  margin-left: 29px;
  margin-top: 24px;
}

#bracket {
  margin-left: 8px;
  color: #8f8e94;
  font-size: 14px;
}

#allJurisdiction {
  float: right;
  margin-right: 118px;
  color: #38adff;
  font-size: 14px;
}

.BasicPermissions {
  width: 75%;
  height: auto;
  margin-left: 108px;
  margin-top: 16px;
}

.BasicPermissions ul li {
  width: 100%;
  height: 40px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  color: #303030;
  font-size: 12px;
}

.BasicPermissions ul li div {
  display: inline-block;
}

#first {
  width: auto;
  height: 36px;
  line-height: 36px;
  font-size: 14px;
}

.ato {
  width: auto;
  height: 40px;
  line-height: 40px;
}

.allAA {
  width: auto;
  height: 40px;
  line-height: 40px;
  float: right;
}

.save {
  width: 100px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  background-color: #38adff;
  border-radius: 4px;
  margin: 30px auto;
}

.save a {
  display: inline-block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: #ffffff;
  font-size: 16px;
}

.radio_inner {
  margin-top: 1px;
  margin-left: -20px;
  float: left;
  width: 14px;
  height: 14px;
}

label.checked .radio_inner {
  background-position: -98px -113px;
}

.radio_origins {
  opacity: 0;
  z-index: -1;
  position: absolute;
}

.grayColor {
  color: #ccc;
}

/*弹出框*/

.ModalsBox {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: #30313370;
  z-index: 999;
}

.Modals {
  position: absolute;
  left: 0;
  top: 0px;
  right: 0;
  bottom: 0;
  margin: auto auto;
  width: 648px;
  height: 292px;
  box-shadow: 0 5px 3px #cccccc;
  border-radius: 5px;
  animation: madalsBox 0.8s;
  background: #fff;
}

@keyframes madalsBox {
  from {
    transform: translateY(-200px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes madalsBoxLeft {
  from {
    right: -400px;
  }
  to {
    right: 0;
  }
}

.ModalsLeft {
  position: absolute;
  right: 0;
  width: 420px;
  height: 100%;
  box-shadow: -2px 1px 4px 0 #dbdbdb;
  border-radius: 5px;
  animation: madalsBoxLeft 0.8s;
  background: #fff;
}

.modalsTop {
  width: 100%;
  height: 64px;
  background-color: #38adff;
  text-align: center;
  line-height: 64px;
  color: #ffffff;
  font-size: 16px;
}

.modalsBot {
  width: 100%;
  height: 228px;
  background-color: #ffffff;
}

.anNiu {
  width: auto;
  height: auto;
  margin-top: 44px;
  text-align: center;
}

.modalsLeftTop {
  width: 420px;
  height: 64px;
  line-height: 64px;
  font-size: 22px;
  padding-left: 25px;
  border-bottom: 1px solid #dbdbdb;
  position: absolute;
  top: 0;
  left: 0;
  background: #fff;
  z-index: 1000;
}

.ModalsLeftMain {
  padding: 64px 20px 110px 20px;
  overflow-y: auto;
  height: 100%;
}

.modalLeftfoot {
  text-align: center;
  position: absolute;
  bottom: 0px;
  width: 420px;
  padding-bottom: 25px;
}

.modalLeftfoot input[type="button"] {
  width: 96px;
  height: 36px;
  border-radius: 2px;
}

.wangEditor-menu-container .menu-group {
  padding: 0 4px !important;
}

.font_16 {
  font-size: 16px;
}

.el-select__tags {
  max-height: 100px !important;
  overflow-y: auto !important;
}
</style>